Giter VIP home page Giter VIP logo

hafas-monitor-departures-ws-server's Introduction

hafas-monitor-departures-ws-server

A WebSocket server wrapping hafas-monitor-departures.

Deprecated. Use hafas-live-ws-server instead.

npm version build status ISC-licensed chat with me on Gitter support me on Patreon

Installing

npm install hafas-monitor-departures-ws-server

Usage

const createHafas = require('vbb-hafas')
const http = require('http')

const createMonitorServer = require('.')

const stations = [ // array of station ids
	'900000100003' // alexanderplatz
]
const interval = 5 * 1000 // every 5 seconds

const httpServer = http.createServer()
const hafas = createHafas('my-awesome-program')
createMonitorServer(httpServer, hafas, stations, interval)
httpServer.listen(3000)

Let a client receive the data:

const WebSocket = require('ws')

const client = new WebSocket('ws://localhost:3000/')
client.on('message', (msg) => {
	try {
		const departure = JSON.parse(msg)
		console.log(departure)
	} catch (err) {
		console.error(err)
	}
})

Contributing

If you have a question or have difficulties using hafas-monitor-departures-ws-server, 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.

hafas-monitor-departures-ws-server's People

Contributors

derhuerst avatar greenkeeper[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

hafas-monitor-departures-ws-server's Issues

An in-range update of bufferutil is breaking the build 🚨

The dependency bufferutil was updated from 4.0.0 to 4.0.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

bufferutil is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 8 commits.

  • e367139 [dist] 4.0.1
  • 7cc7367 [minor] Set NAPI_VERSION to 1
  • ff6e157 chore(package): update prebuildify to version 2.10.0 (#112)
  • 283561c fix(package): update node-gyp-build to version 3.7.0 (#111)
  • 9ae2b52 fix(package): update node-gyp-build to version 3.6.0 (#110)
  • 8eff02e chore(package): update prebuildify to version 2.9.1 (#109)
  • 7d5c4dd fix(package): update node-gyp-build to version 3.5.0 (#108)
  • 1a83453 chore(package): update prebuildify to version 2.8.0 (#107)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.