TFL - Node
This is a node package for interacting with the Transport for London (TFL) api.
It comes with a tool for accessing this data directly via the command line, or can be used within your own projects.
$ npm install -g tfl
move binary to /usr/local/bin ?
$ tfl tube --line District
$ tfl tube --station Aldgate East
Overground (Work in Progress)
$ tfl overground --station London Bridge
Buses (Work in Progress)
$ tfl bus --route 66
Cycle Hire (Work in Progress)
$ tfl cycle ...
Roads (Work in Progress)
$ tfl road --name Park Lane
Route Status This will perform a search for the typical route taken between two roads and retrieve the statuses for each road on the route.
$ tfl road --from "Whitechapel Road" --to "Park Lane"
Road Traffic Cam
$ tfl road --camera Park Lane
Using the package in your own projects
Require the tfl package as usual:
var tfl = ;
Since each command sends a request to the TFL api, the response is returned in a promise. For example, to get the current list of incidents on tube lines you can call:
The function passed into
then() will be called asynchronously once the request to the api has returned and been processed.
Tube / Overground
tfltubestatus 'incidents': true ;tflovergroundstatus 'incidents': true ;
Line (Work in Progress)
tfltube;// Overground services do not provide line information
Station (Work in Progress)
Arrivals (Work in Progress)
Journey (Work in Progress)