0.1.0 • Published 3 years ago

hk-nextbus v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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