Skip to content

dowmeister/etcars-node-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THE PROJECT HAS BEEN DISCONTINUED. PLEASE DON'T OPEN ISSUES.

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.