@djforth/geolocation_helper

A small Geolocation api helper

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
07May 25, 2021Mar 7, 2016Minified + gzip package size for @djforth/geolocation_helper in KB

Readme

Geolocation helper

@djforth/geolocation_helper

A Small util for Geolocation api.

Install:

npm install --save @djforth/geolocation_helper

Standard set up:

var Geo_helper = require("@djforth/geolocation_helper");

//Will return undefined if geolocation api is not avaiable
var geo = Geo_helper();

if(geo){
  geo(function(lat, lng, pos){
    //Success - Do something with data

  },
  function(err){
    //Failure - Do something with error
  });
}

If you wanted to add a timeout to request:

var Geo_helper = require("@djforth/geolocation_helper");

//Will return undefined if geolocation api is not avaiable
var geo = Geo_helper(5000); //Will timeout after 5 secs

if(geo){
  geo(function(lat, lng, pos){
    //Success - Do something with data

  },
  function(err){
    //Failure - Do something with error
  });
}

Bug reports

If you discover any bugs, feel free to create an issue on GitHub. Please add as much information as possible to help us fixing the possible bug. We also encourage you to help even more by forking and sending us a pull request.

https://github.com/djforth/geolocation_helper/issues

Contribute

If you'd like to contribute, geolocation_helper is written using babel in ES6.

Please make sure any additional code should be covered in tests (Jasmine using karma).

If you need to run the test please use:


npm test

or to rebuild the JS run:


npm run build

Maintainers

Adrian Stainforth (https://github.com/djforth)

License

geolocation_helper is an open source project falling under the MIT License. By using, distributing, or contributing to this project, you accept and agree that all code within the geolocation_helper project are licensed under MIT license.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.