trafikverket
v1.4.0
Published
A wrapper for the Trafikverket API that provides information about trains in Sweden.
Downloads
7
Maintainers
Readme
Trafikverket Wrapper
A wrapper for the Trafikverket API that provides information about trains in Sweden.
Usage
let trafikverket = require('trafikverket')
trafikverket.getDepartures('Cst', 'Flen')
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:
- [x]
trafik.getDepartures('Cst', 'Fle')
(When 'Fle' is not the final destination) - [x] Create service to return station info (sync?)
- [x] Parametrize the time interval
- [ ] Filter anouncements without data