@derhuerst/location

1.0.0 • Public • Published

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!

build status dependency status dev dependency status ISC-licensed chat on gitter

See also:

Installing

npm install @derhuerst/location

Keep 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.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @derhuerst/location

    Weekly Downloads

    6

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    10.4 MB

    Total Files

    6

    Last publish

    Collaborators

    • derhuerst