1.0.4 • Published 6 years ago

etcars-node-client v1.0.4

Weekly downloads
5
License
ISC
Repository
github
Last release
6 years ago

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.

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago