Neologistic Paraphasic Mumbling
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

browser-location

1.0.1 • Public • Published

browser-location Build Status

Geolocation for the browser with a Node-friendly API

Install

$ npm install --save browser-location

Usage

var location = require('browser-location')
 
location.get(function (err, position) {
  //=> null, {coords: {...}, timestamp: ...}  
})

API

location.get([options], callback) -> undefined

options

Type: object
Default: {}

A PositionsOptions object that will be passed to the geolocation API.

callback

Required
Type: function Arguments: err, position

A callback that will be called with an error or a Position object. The error will be a GeolocationNotSupported error if geolocation is not supported. Otherwise it will be a PositionError.

location.GeolocationNotSupportedError(message) -> error

The constructor for the error that is returned in browsers that do not support geolocation. Exposed as a convenience so your code can distinguish between error states.

message

Type: string
Default: 'Geolocation is not supported'

License

MIT © Ben Drucker

install

npm i browser-location

Downloadsweekly downloads

3

version

1.0.1

license

MIT

repository

githubgithub

last publish

collaborators

  • avatar