Capital-Bike-Share.js
Install
$ npm install capital-bike-share-js --save
API
getAll(callback)
callback(err, data)
- returns all stations
getMultiple(ids, callback)
ids
array of strings - the ids of the bike stations you wantcallback(err, data)
- returns the station that matches the given id
getById(id, callback)
id
numbercallback(err, data)
- returns the station that matches the given id
getByName(name, callback
name
stringcallback(err, data)
- returns the station that matches the given name
getByClosest(location, limit, callback)
location
obj{latitude: number, longitude: number}
limit
numbercallback(err, data)
- returns stations within the limit that are closest to the location given. Uses haversine geo-distance formula.
Examples
var api = ;var coord1 = latitude: 389059581 longitude: -770416805 // Get allapi; // Get by IDapi; // Get by nameapi; // Get closestapi;