Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

capital-bike-share-js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capital-bike-share-js

Capital Bike Share Api

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Capital-Bike-Share.js

Build Status

###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 want
  • callback(err, data)
  • returns the station that matches the given id
getById(id, callback)
  • id number
  • callback(err, data)
  • returns the station that matches the given id
getByName(name, callback
  • name string
  • callback(err, data)
  • returns the station that matches the given name
getByClosest(location, limit, callback)
  • location obj {latitude: number, longitude: number}
  • limit number
  • callback(err, data)
  • returns stations within the limit that are closest to the location given. Uses haversine geo-distance formula.

Examples

var api = require('capital-bike-share-js');
var coord1 = {
  latitude: 38.9059581,
  longitude: -77.0416805
}

// Get all
api.getAll(function(err, data) {
  // do something with data;
});


// Get by ID
api.getById(30, function(err, data) {
  // do something with data;
});


// Get by name
api.getByName('John McCormack Dr & Michigan Ave NE', function(err, data) {
  // do something with data;
});


// Get closest
api.getByClosest(coord1, 5, function(err, data) {
  // do something with data;
});

Keywords

FAQs

Package last updated on 17 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc