Catalog npm
Back to packageRELEASE DETAILS

1.1.3

npm

7f

7F protocol library for node.js

Published29 Sept 2014
Direct dependencies4
Transitive dependenciesNot calculated

README

Current package documentation

lib7f

7F protocol library for Node.js

Build Status Dependency Status NPM version

Usage

npm install 7f

Server

lib7f  = require "7f"
server = new lib7f.Server
server.on "client", (client) ->
  client.on "message", (msg) ->
    console.log msg
    header = {nr: 1}
    advancedHeader =
      logicalNr:  1245
      command:    lib7f.constants.Command.TO
      type:       lib7f.constants.DataType.BYTEARRAY
      count:      3
    data = new Buffer 7
    msg = new lib7f.Message header, advancedHeader, data
    client.send msg

server.on "reconnect", (client) ->
  console.log "client #{client.id} has reconnected"

server.connect -> # the server is ready

You can also specify the port, the server address to which the server should be bound to, the servers specification number and it's login function ID:

server = new lib7f.Server
  host: "192.168.10.30"
  port: 5010
  specificationNr: 8
  loginFunctionId: 5

Client


lib7f  = require "7f"

client = new lib7f.Client 7,
  host: "192.168.0.100"
  port: 5010
  specificationNr: 3
  loginFunctionId: 9

client.on "message", (msg) ->
  console.log msg
  header = {nr: 4}
  advancedHeader =
    logicalNr:  54
    command:    lib7f.constants.Command.FETCH
    type:       lib7f.constants.DataType.WORD
    count:      9
  data = new Buffer 33
  msg = new lib7f.Message header, advancedHeader, data
  client.send msg

client.on "error", (err) ->
  console.log "something went wrong"

client.on "login", ->
  console.log "client is now logged in"

client.on "connect", ->
  console.log "client is connected"
  client.login()

client.on "disconnect", ->
  console.log "client is now disconnected"

client.connect()

License

GPLv3

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 4

Native requirements
4 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
bits
Environment
{
  "local_name": "bits",
  "alias": false,
  "peer_metadata": null
}
~0.1.1runtime
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^1.9.1development
coffee-script
Environment
{
  "local_name": "coffee-script",
  "alias": false,
  "peer_metadata": null
}
~1.8.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^1.21.4development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "88d2cb194fceeb96db7b24bc710b283451e7a851",
  "tarball": "https://registry.npmjs.org/7f/-/7f-1.1.3.tgz",
  "integrity": "sha512-1gETEtJY35yPbpHv5vFaTbUIYy+gkOhAF6jbVa96uZ8emftfLTLafKmsIVY197PN4zwhm7tUmo3urtNBsdCkwg==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQDYul4OWgmE9W4I9mvG18SUkOFRBa49TT3XilBWMfzjxAIgLx69qFFx3/5X0fC0ES9ziR93DzS3Unwp5z23ygWKPWE="
    }
  ]
}

Repository

PENDING
flosse/node-7f

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:780cbe35c565f44fc39ece26ca30f7bc136d2319cc2d0c1e5d32ae3a1398d367

Other collected versions

1.1.29 Jan1.1.112 Dec1.1.04 Dec1.0.123 Oct1.0.018 OctView all collected versions →