1.0.0 • Published 8 years ago
@derhuerst/location v1.0.0
location
Get your current location from the OS, using a small Swift helper and wifi-triangulate.
Linux or Windows user? Help me support them with this module!
See also:
- browser-locationfor Browsers
- isomorphic-locationfor Browsers & Node
Installing
npm install @derhuerst/locationKeep in mind that the npm package contains a binary that will be executed. If you don't trust me or think that your users won't trust me, build the binary yourself from the source code.
Usage
const location = require('@derhuerst/location')
location((err, loc) => {
	if (err) console.error(err)
	else console.log(loc)
})This will give you something similar to the following:
{
	latitude: 52.547172,
	longitude: 13.347745,
	precision: 65, // in meters
	native: true
}API
location([timeout], cb)timeout is in milliseconds, optional and 10 * 1000 by default. cb(err, loc) follows the Node callback convention.
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.