trafikverket

    1.4.0 • Public • Published

    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?
    $ 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

    Install

    npm i trafikverket

    DownloadsWeekly Downloads

    1

    Version

    1.4.0

    License

    MIT

    Last publish

    Collaborators

    • eduardoportilho