hk-nextbus
v0.1.0
Published
Non-official Node.JS wrapper for Next Bus
Downloads
2
Readme
Next Bus (Hong Kong)
Non-official Node.JS wrapper for Next Bus
Resources
Getting Started
Install
npm install hk-nextbus
Usage
import { NextBus } from 'hk-nextbus';
// or
const { NextBus } = require('hk-nextbus');
const company_id = 'CTB';
const route = '1';
const direction = 'outbound';
const stop_id = '002737';
const { data: companyData } = await NextBus.getCompany({ company_id });
const { data: routesData } = await NextBus.getAllRoutes({ company_id });
const { data: routeData } = await NextBus.getRoute({ company_id, route });
const { data: routeStopData } = await NextBus.getRouteStop({ company_id, route, direction });
const { data: etaData } = await NextBus.getETA({ company_id, stop_id, route });