tfl-api-client
v0.0.13
Published
> A socket.io wrapper for the https://api.tfl.lu streaming API<br /> > This packages uses UMD, so it can be used as commonjs, amd package and can be loaded via script tag
Downloads
4
Readme
Tfl-API-Client
A socket.io wrapper for the https://api.tfl.lu streaming API This packages uses UMD, so it can be used as commonjs, amd package and can be loaded via script tag
Install with npm
npm install tfl-api-client
Build Setup
# install dependencies
npm install
# Run demo at localhost:8080
npm install
npm run start
How to use client using script tag
<script src="path/to/node_modules/tfl-api-client/dist/bundle.js"></script>
<script>
var api = new TfLAPIClient('https://api.tfl.lu/v1');
api.subscribe('/BikePoint', function(data) {
console.log(data)
});
</script>
How to use client using commonjs
const TfLAPIClient = require('tfl-api-client');
var api = new TfLAPIClient('https://api.tfl.lu/v1');
api.subscribe('/BikePoint', function(data) {
console.log(data)
});