Socket
Socket
Sign inDemoInstall

wifi-on-ice-position-stream

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wifi-on-ice-position-stream - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

9

index.js

@@ -6,3 +6,3 @@ 'use strict'

const createPositionsStream = (interval = 5 * 1000) => {
const createPositionsStream = (interval = 5 * 1000, closeOnTrainChange = false) => {
if (

@@ -21,2 +21,3 @@ 'number' !== typeof interval ||

let lastTzn = null
const fetch = () => {

@@ -27,2 +28,8 @@ const t = Date.now()

.then((data) => {
if (data.tzn && lastTzn && closeOnTrainChange && data.tzn !== lastTzn) {
out.close()
return;
}
lastTzn = data.tzn
data.clientTime = t

@@ -29,0 +36,0 @@ out.push(data)

2

license.md

@@ -1,2 +0,2 @@

Copyright (c) 2018, Jannis R
Copyright (c) 2020, Jannis R

@@ -3,0 +3,0 @@ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

{
"name": "wifi-on-ice-position-stream",
"description": "A stream of ICE positions, taken from the on-board WiFi.",
"version": "0.1.0",
"version": "0.1.1",
"main": "index.js",

@@ -14,5 +14,3 @@ "files": [

"movement",
"track",
"gps",
"gpx"
"track"
],

@@ -19,0 +17,0 @@ "author": "Jannis R <mail@jannisr.de>",

@@ -23,3 +23,3 @@ # wifi-on-ice-position-stream

const positions = createSteam()
const positions = createStream()
positions.once('data', (position) => {

@@ -50,4 +50,17 @@ console.log(position)

## API
```js
createPositionsStream(interval = 5 * 1000, closeOnTrainChange = false)
```
## Related
- [`wifi-on-ice-portal-client`](https://github.com/derhuerst/wifi-on-ice-portal-client) – Query information from the WifiOnICE portal in German ICE trains.
- [`record-ice-movement`](https://github.com/derhuerst/record-ice-movement) – Record the movement of any ICE using the on-board WiFi.
## 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](https://github.com/derhuerst/wifi-on-ice-position-stream/issues).
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc