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

Dependencies (0)

    Dev Dependencies (11)

    Package Sidebar

    Install

    npm i tfl-api-client

    Weekly Downloads

    12

    Version

    0.0.13

    License

    MIT

    Unpacked Size

    560 kB

    Total Files

    11

    Last publish

    Collaborators

    • dattn
    • pukkatea