8000 GitHub - eduardoportilho/trafikverket: 🚂 A wrapper for the Trafikverket API which provides information about trains in Sweden.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

eduardoportilho/trafikverket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trafikverket Wrapper

travis build codecov coverage version MIT License semantic-release

NPM

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?
$ npm run build
$ cd dist
$ 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, null, 2)))

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

About

🚂 A wrapper for the Trafikverket API which provides information about trains in Sweden.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published
0