Nurturing Palpable Magnificence
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

tfl-api-client

0.0.13 • Public • Published

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)
});

Keywords

none

install

npm i tfl-api-client

Downloadsweekly downloads

2

version

0.0.13

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability