Trafikverket Wrapper
A wrapper for the Trafikverket API that provides information about trains in Sweden.
Usage
let trafikverket = trafikverket
FAQ
- How do I set my API key in my host?
export TRAFIKVERKET_API_KEY=<your API key>
- How do I test the api?
$ env TRAFIKVERKET_API_KEY=<your API key> NODE_ENV=production node
> let trafik = require('./index')
> trafik.getDepartures('Fle').then((obj) => console.log(JSON.stringify(obj)))
Roadmap:
-
trafik.getDepartures('Cst', 'Fle')
(When 'Fle' is not the final destination) - Create service to return station info (sync?)
- Parametrize the time interval
- Filter anouncements without data