etcars-node-client
v1.0.4
Published
ETCars Node.js client
Downloads
12
Readme
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 socketdata
: fired when receive data from ETCarserror
: fired on error and on disconnection
Used in
- Virtual Trucker Rich Presence Discord plugin - https://github.com/LasseNiermann/Virtual-Trucker-Rich-Presence
Contributors
- jammerxd - https://github.com/jammerxd
- DrEGZo - https://github.com/DrEGZo
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.