api-tan-wrapper

1.1.0 • Public • Published

api-tan-wrapper

Little node wrapper for Tan API.

This little wrapper allow you to get all stations, can deliver similar stations name and time left for a station.

NPM

npm version license issues forks stars

Installation

yarn add api-tan-wrapper

Usage

const TanWrapper = require('api-tan-wrapper');
const tan = new TanWrapper({
    production: true, // default: false // You can use NODE_ENV = production too
    locale: 'fr_FR' // default: 'fr_FR'
});
 
// Get all stations
await tan.getAllStations();
 
// Get stations in a 500m range of the location
await tan.getStationsWithLocation(latitude, longitude)
 
// Get all tram stations
await tan.getAllTramStations();
 
// Get all bus stations
await tan.getAllBusStations();
 
// Get waiting time at station
await tan.getWaitingTimeFromStation('beaujoire', 'name'); // or tan.getWaitingTimeFromStation('bjoi');
 
// Get times from station
await tan.getTimesFromStation('beaujoire', 'name', 1, 2); // or tan.getTimesFromStation('bjoi', 1, 2);
 
// Get array of stations name
tan.parseStationsToList(stations); // stations here is the result of tan.getAllStations();
 
// Get station from station name
await tan.getStationFromCode('beaujoire');
 
// Get station from code
await tan.getStationFromCode('bjoi');
 
// Get similar stations name
tan.getSimilarStationsName('beauséjour', ['beaujoire', 'commerce', ...], 2); // 2 is the number of similar stations you want to get in return

Licence

MIT @Toinane

Readme

Keywords

none

Package Sidebar

Install

npm i api-tan-wrapper

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

6.24 kB

Total Files

5

Last publish

Collaborators

  • toinane