{"id":22092238,"url":"https://github.com/pirxpilot/kompas","last_synced_at":"2025-07-24T20:32:04.920Z","repository":{"id":136536613,"uuid":"154176117","full_name":"pirxpilot/kompas","owner":"pirxpilot","description":"Calculates heading based on \"deviceorientation\" event.","archived":false,"fork":false,"pushed_at":"2025-06-13T00:55:08.000Z","size":22,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-13T01:43:09.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pirxpilot.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-22T16:20:10.000Z","updated_at":"2025-06-13T00:54:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"c244ac85-b6a3-4f08-947d-3e4adf3c7439","html_url":"https://github.com/pirxpilot/kompas","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"0627d510b5b770be76c4e0ad91192417d63f4109"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pirxpilot/kompas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fkompas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fkompas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fkompas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fkompas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pirxpilot","download_url":"https://codeload.github.com/pirxpilot/kompas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pirxpilot%2Fkompas/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265509541,"owners_count":23779375,"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-12-01T03:08:50.374Z","updated_at":"2025-07-24T20:32:04.613Z","avatar_url":"https://github.com/pirxpilot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version][npm-image]][npm-url]\n[![Build Status][build-image]][build-url]\n[![Dependency Status][deps-image]][deps-url]\n\n# kompas\n\nCalculates heading based on `deviceorientation` event.\nThe algorithm is a version proposed in the [stackoverflow answer] and [deviceorientation spec] modified for [chrome].\nCheck out [demo] page to see how it works on your device.\n\n## Install\n\n```sh\n$ npm install --save kompas\n```\n\n## Usage\n\n```js\nconst kompas = require('kompas');\n\n// start watching and add callback\nkompas.watch();\n\n\nkompas.on('heading', function(heading) {\n  console.log('Heading:', heading);\n});\n\n// stop watching\nkompas.clear();\n\n```\n\n## License\n\nMIT © [Damian Krzeminski](https://pirxpilot.me)\n\n[demo]: https://pirxpilot.github.io/kompas/\n\n[stackoverflow answer]: https://stackoverflow.com/questions/18112729/calculate-kompas-from-deviceorientation-event-api#21829819\n[deviceorientation spec]: https://w3c.github.io/deviceorientation/#worked-example\n\n[chrome]: https://developers.google.com/web/updates/2016/03/device-orientation-changes\n\n[npm-image]: https://img.shields.io/npm/v/kompas\n[npm-url]: https://npmjs.org/package/kompas\n\n[build-url]: https://github.com/pirxpilot/kompas/actions/workflows/check.yaml\n[build-image]: https://img.shields.io/github/actions/workflow/status/pirxpilot/kompas/check.yaml?branch=main\n\n[deps-image]: https://img.shields.io/librariesio/release/npm/kompas\n[deps-url]: https://libraries.io/npm/kompas\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fkompas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpirxpilot%2Fkompas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpirxpilot%2Fkompas/lists"}