Socket
Socket
Sign inDemoInstall

wifi-on-ice-position-stream

Package Overview
Dependencies
14
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    wifi-on-ice-position-stream

A stream of ICE positions, taken from the on-board WiFi.


Version published
Weekly downloads
5
increased by400%
Maintainers
1
Install size
7.48 MB
Created
Weekly downloads
 

Readme

Source

wifi-on-ice-position-stream

A stream of ICE positions, taken from the on-board WiFi.

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installation

npm install wifi-on-ice-position-stream

Usage

const createStream = require('wifi-on-ice-position-stream')

const positions = createStream()
positions.once('data', (position) => {
	console.log(position)
	positions.destroy()
})

createStream() returns a readable stream in object mode.

Each position/chunk is in the format of wifi-on-ice-portal-client with an additional clientTime field:

{
	ok: true,
	speed: 245,
	gpsOk: true,
	latitude: 51.86973533333333,
	longitude: 9.989614166666666,
	servicelevel: 'AVAILABLE_SERVICE',
	wagonClass: 'FIRST',
	serverTime: 1504698041985,
	clientTime: 1504698041872
}

You may pass these options to createStream(opt):

  • interval – How often to fetch the current position from the on-board WiFi, in milliseconds. Default: 5000
  • endOnTrainChange – End the stream as soon as the Triebzugnummer reported by the on-board WiFi changes, e.g. when your client accidentally connects to the WiFi of a different train. Default: true

Contributing

If you have a question or have difficulties using wifi-on-ice-position-stream, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

Keywords

FAQs

Last updated on 28 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc