A Node.js wrapper for fetching live departures of popular public transport providers/utilities across the world.
npm i public-transport
Require the public-transport module in your project
var timetable = require('public-transport');
var p = timetable.departures(options);
p.then(function(value) {
console.log("Closest Match: " + value.station.name);
value.departures.prettyPrint();
});
- Germany (S-bahn, U-Bahn, ICE, IC, etc)
- India (Indian Railways)
- For Germany
var p = publictransport.departures({ type: 'dbahn', station: 'hausener weg', products: 'u' });
'product' - product filter
- For India
var p = publictransport.departures({ type: 'irctc', station: 'bhubaneswar'});
departures method returns a Promise which returns a timetable object on completion. prettyPrint() method in the timetable object display a formatted timetable.
Please raise issues for expected features or contribute by pull requests : )