{"id":18774188,"url":"https://github.com/leny/jeolok","last_synced_at":"2025-12-14T06:30:16.297Z","repository":{"id":19488129,"uuid":"22734024","full_name":"leny/jeolok","owner":"leny","description":"Improved navigator.geolocation, with better callbacks and new stuffs.","archived":false,"fork":false,"pushed_at":"2019-10-22T18:51:31.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T09:04:53.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leny.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-07T19:34:07.000Z","updated_at":"2019-10-22T18:51:33.000Z","dependencies_parsed_at":"2022-07-10T08:01:04.502Z","dependency_job_id":null,"html_url":"https://github.com/leny/jeolok","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fjeolok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fjeolok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fjeolok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leny%2Fjeolok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leny","download_url":"https://codeload.github.com/leny/jeolok/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239680988,"owners_count":19679509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T19:37:41.625Z","updated_at":"2025-12-14T06:30:16.226Z","avatar_url":"https://github.com/leny.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jeolok\n\n![NPM version](http://img.shields.io/npm/v/jeolok.svg) ![Downloads counter](http://img.shields.io/npm/dm/jeolok.svg) [![Bower package version](https://badge.fury.io/bo/jeolok.svg)](http://badge.fury.io/bo/jeolok) [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n\u003e Improved navigator.geolocation, with better callbacks and new stuffs.\n\n* * *\n\n**jeolok** is a simple wrapper over navigator.geolocation, with better callback support, so you can use it with  tools like *async*.\n\n## Getting Started\n\nFrom now, **jeolok** is only usable in the browser (since it uses `navigator.geolocation` as interface).\n\n**jeolok** use the [umd](https://github.com/umdjs/umd) implementation to be usable with whatever tool you use (browserify, vanilla, etc...).\n\nYou can install **jeolok** using *npm* or *bower*, or downloading the library from the [lib](https://github.com/leny/jeolok/tree/master/lib) folder.\n\n## Documentation\n\nRegardless of how you will include **jeolok** in your code, you will obtain a `jeolok` object, which has the following methods \u0026 properties.\n\n### `getCurrentPosition( [ options [, [ callback ]] )`\n\nCalls `navigator.geolocation.getCurrentPosition()`, with the given (and optional) [options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions), and execute the callback when it's done.\n\nThe callback will get two arguments : the first is an `error`, which be `null` if everythings is alright, and the second is the [`position` object](https://developer.mozilla.org/en-US/docs/Web/API/Position).  \nThe `position` object has an extra parameter : `date`, which his a `Date` object of the position's `timestamp`.\n\n#### Example\n\n```javascript\n\njeolok.getCurrentPosition( { enableHighAccuracy: true }, function( error, position ) {\n    if( error ) {\n        return console.error( \"Shit happens!\", error );\n    }\n    console.log( \"Now i can work with my position:\", position );\n} );\n\n```\n\n### `get( [ options [, [ callback ]] )`\n\nAlias of `getCurrentPosition`.\n\n### `watchPosition( [ options [, [ callback ]] )`\n\nCalls `navigator.geolocation.watchPosition()`, with the given (and optional) [options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions), and execute the callback everytime it's has new information about position.\n\nThe callback will get two arguments : the first is an `error`, which be `null` if everythings is alright, and the second is the [`position` object](https://developer.mozilla.org/en-US/docs/Web/API/Position).  \nThe `position` object has an extra parameter : `date`, which his a `Date` object of the position's `timestamp`.\n\nReturns the watch's id, which it usefull to clear it (see below).\n\n#### Example\n\n```javascript\n\nvar watchID = jeolok.watchPosition( { enableHighAccuracy: true }, function( error, position ) {\n    if( error ) {\n        return console.error( \"Shit happens!\", error );\n    }\n    console.log( \"I must have moved since the last time, i think:\", position );\n} );\n\n```\n\n### `watch( [ options [, [ callback ]] )`\n\nAlias of `watchPosition`.\n\n### `clearWatch( watchID )`\n\nCalls `navigator.geolocation.clearWatch()`, with the given id, to stop watching for location changes.\n\n#### Example\n\n```javascript\n\njeolok.clearWatch( watchID );\n\n```\n\n### `position`\n\n**jeolok** keeps the last `position` object in its memory.\n\n#### Example\n\n```javascript\n\nconsole.log( \"Hey, I got a latitude: \", jeolok.position.coords.latitude );\n\n```\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Lint your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n\n* **0.1.0**: Initial release (*07/08/14*)\n\n## License\nCopyright (c) 2014 leny  \nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleny%2Fjeolok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleny%2Fjeolok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleny%2Fjeolok/lists"}