New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nearest-coffee

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nearest-coffee

gets the nearest cafe to the given lat/long

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

nearest-coffee

stable

Client-side Google Places search for coffee shops near the given Lat/Lng.

var coffee = require('nearest-coffee')
coffee({ 
    location: [40.758895, -73.985131], 
    radius: 1000
}, function(err, data) {
    if (err) 
        throw err

    var places = data.map(function(d) {
        return d.name
    })

    console.log(places)
})

Assumes google is already a global, e.g. via:

<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>

PRs for Node version welcome.

Usage

NPM

coffee(opt[, callback])

If opt is an array, it's assumed to be a simple [lat, lng]. Otherwise you can pass any options for the Places API, including:

  • radius in meters, defaults to 500. max is 50,000 m
  • location a Google Map, LatLng object, or simple [lat, lng] array`
  • keyword a term to match
  • name a name to match
  • rankBy can be 'prominence' (default) or 'distance' (will ignore radius)
  • types which defaults to ['cafe']
  • element the Map, or a DOM element that receives attributions (required per Terms of Service)

License

MIT, see LICENSE.md for details.

Keywords

FAQs

Package last updated on 25 Nov 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