Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.
/ nextbus-js Public archive

Node.js interface to the NextBus XML Feed

License

Notifications You must be signed in to change notification settings

elliottsj/nextbus-js

Repository files navigation

nextbus-js

npm version Travis CI Build Status

Node.js interface to the NextBus XML Feed

Installation

npm install nextbus

Usage

import nextbus from 'nextbus';
// or:
// const nextbus = require('nextbus').default;

const nb = nextbus();
// or:
// const nb = nextbus({
//   host: 'webservices.nextbus.com', // optional; default is shown
//   protocol: 'http:',               // optional; default is shown
// });

nb.getAgencies().then((agencies) => {
  expect(agencies).toEqual([
    {
      regionTitle: 'California-Northern',
      tag: 'actransit',
      title: 'AC Transit',
    },
    {
      regionTitle: 'Maryland',
      tag: 'jhu-apl',
      title: 'APL',
    },
    {
      regionTitle: 'North Carolina',
      tag: 'art',
      title: 'Asheville Redefines Transit',
    },
    // ...
  ]);
});

About

Node.js interface to the NextBus XML Feed

Resources

License

Stars

Watchers

Forks

Packages

No packages published