mirror of
https://github.com/JakeStanger/tfl-api-wrapper.git
synced 2026-07-11 07:04:41 +01:00
A Node JS wrapper for the Transport for London Unified API and TrackerNet
- TypeScript 99.7%
- JavaScript 0.3%
| .github | ||
| docs | ||
| lib | ||
| static | ||
| tests | ||
| typedoc | ||
| .gitignore | ||
| .gitpod.yml | ||
| .prettierignore | ||
| .prettierrc | ||
| CHANGELOG.md | ||
| index.ts | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| typedoc.json | ||
| yarn.lock | ||
TfL API Wrapper
A NodeJS wrapper for the TfL Unified API, made with TypeScript.
Read the Documentation
Installation
npm install tfl-api-wrapper
yarn add tfl-api-wrapper
Contribute
There are many ways to contribute to this repo.
- Submit bugs and help us verify fixes as they are checked in.
- Review the source code changes.
Example Usage
Async... await
import { StopPoint } from 'tfl-api-wrapper';
const app_key = 'API KEY HERE'; // Use an environment file
const stopPoint = new StopPoint(app_key)
const arrivals = await stopPoint.getStationArrivals('940GZZLUKSX');
console.log(arrivals);
Callback
import { StopPoint } from 'tfl-api-wrapper';
const app_key = 'API KEY HERE'; // Use an environment file
const stopPoint = new StopPoint(app_key)
stopPoint.getStationArrivals('940GZZLUKSX').then((arrivals) => {
console.log(arrivals)
});
Disclaimer
This repository is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Transport for London (TfL) or it's parent organisation Greater London Authority (GLA)