etcars-node-client

1.0.4 • Public • Published

ETCars Node.js client

This simple package supply basic integration for a node.js application to connect and receive data from ETCars .

Implements EventEmitter.

No dependencies.

Install

npm install --save etcars-node-client

Usage

var ETCarsClient = require('etcars-node-client');
 
var etcars = new ETCarsClient();
// to enable debug console.log and console.error
etcars.enableDebug = true;
 
etcars.on('data', function(data) {
    console.log('data received');
});
 
etcars.on('connect', function(data) {
    console.log('connected');
});
 
etcars.on('error', function(data) {
    console.log('etcars error');
});
 
etcars.connect();

Events

You can subscribe this events wia on method:

  • connect : fired when connected to ETCars socket
  • data : fired when receive data from ETCars
  • error : fired on error and on disconnection

Used in

Contributors

API

Table of Contents

ETCarsClient

Extends EventEmitter

isConnected

Denotes if internal socket is in state CONNECTED

isConnecting

Denotes if internal socket is in state CONNECTING

enableDebug

Enable console.log and console.error

Parameters

  • value

connect

Connect or try to connect to ETCars. If not running, poll until ETCars socket will be opened.

Dependents (0)

Package Sidebar

Install

npm i etcars-node-client

Weekly Downloads

6

Version

1.0.4

License

ISC

Unpacked Size

7.56 kB

Total Files

3

Last publish

Collaborators

  • shardick