rejseplan-depatures

0.1.3 • Public • Published

rejseplan-departures

Utilising the API provided by Rejseplanen available here

usage

usage: rjsdep <command> [stations]

  shows the departure table for each station

  <command> can be any of the following and defaults to 'list':
  data    export the data in json format
  list    show a fancy listview of the departures

methods

var departures = require('rejseplan-departures');

departures(stations, options = {}, cb)

Calls the callback cb with signature function(err, departureList) when it has fetched a list of departures from the given stations.

Each station in stations is the ID number used be the Rejseplanen API. Take a look in the data/ directory.

You can pass some options:

  • options.exclude - An array of transport types to exclude. Possible values ['train', 'bus', 'metro']

  • options.date - The date for which the departure-table should be fetched. Can be given in any format that moment understands

example

var departures = require('rejseplan-departures');
departures(['8603307'], { exclude: ['train', 'bus'] }, function(err, deps) {
  // deps should now be an array of metro departures from Nørreport st (Metro).
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.3
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.3
    6
  • 0.1.2
    3
  • 0.1.1
    3
  • 0.1.0
    2

Package Sidebar

Install

npm i rejseplan-depatures

Weekly Downloads

10

Version

0.1.3

License

MIT

Last publish

Collaborators

  • saebekassebil