hkbus demo

node v6.17.1
version: 0.6.0
endpointsharetweet
const HKBus = require('hkbus'); const q = HKBus({ lang: 'cht', operator: 'kmb', // only KMB is supported at the moment verbose: 0 }); // the above are the default options, which is equivalent to: // const q = HKBus();
// get stops for all bound q.getStops('216M') .then(stops => { console.log('All Bounds'); console.log(stops); }) .catch(console.error);
// get ETA q.getEta('216M', 1, 'KA04-N-1000-0', 1) .then(etas => { console.log('ETA'); console.log(etas); }) .catch(console.error);
// get stops for bound 1 q.getStops('3C', 1) .then(console.log) .then(stops => { console.log('Bound 1 only'); console.log(stops); }) .catch(console.error);
Loading…

no comments

    sign in to comment