{"id":15046132,"url":"https://github.com/nativescript-community/insomnia","last_synced_at":"2025-04-10T00:44:09.165Z","repository":{"id":31735741,"uuid":"35301737","full_name":"nativescript-community/insomnia","owner":"nativescript-community","description":":sleepy: NativeScript plugin to keep the device awake (not dim the screen, lock, etc)","archived":false,"fork":false,"pushed_at":"2023-11-22T15:01:23.000Z","size":695,"stargazers_count":41,"open_issues_count":8,"forks_count":11,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-10T00:44:01.609Z","etag":null,"topics":["awake","dimming","insomnia","nativescript","nativescript-plugin","screen"],"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/nativescript-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":["farfromrefug"]}},"created_at":"2015-05-08T21:04:39.000Z","updated_at":"2024-05-30T15:53:40.000Z","dependencies_parsed_at":"2023-11-22T16:28:06.838Z","dependency_job_id":"b4f3d587-22ad-4b90-bfdb-05eb93eb0631","html_url":"https://github.com/nativescript-community/insomnia","commit_stats":{"total_commits":23,"total_committers":6,"mean_commits":"3.8333333333333335","dds":0.4347826086956522,"last_synced_commit":"901011eef45c36baed613509c2b1c2b7594090cf"},"previous_names":["eddyverbruggen/nativescript-insomnia"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Finsomnia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Finsomnia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Finsomnia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nativescript-community%2Finsomnia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nativescript-community","download_url":"https://codeload.github.com/nativescript-community/insomnia/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137998,"owners_count":21053775,"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":["awake","dimming","insomnia","nativescript","nativescript-plugin","screen"],"created_at":"2024-09-24T20:52:45.228Z","updated_at":"2025-04-10T00:44:09.142Z","avatar_url":"https://github.com/nativescript-community.png","language":"JavaScript","readme":"# NativeScript Insomnia\n\n\n[npm-image]:http://img.shields.io/npm/v/nativescript-community/insomnia.svg\n[npm-url]:https://npmjs.org/package/nativescript-community/insomnia\n[downloads-image]:http://img.shields.io/npm/dm/nativescript-community/insomnia.svg\n\n\u003e 💡 Plugin version 2.0.0+ is compatible with NativeScript 7+. If you need to target older NativeScript versions, please stick to plugin version 1.2.3.\n\n## Demo app (Angular)\nThis plugin is part of the [plugin showcase app](https://github.com/EddyVerbruggen/nativescript-pluginshowcase/tree/master/app/ar) I built using Angular.\n\n## Installation\nRun the following command from the root of your project:\n\n```\ntns plugin add @nativescript-community/insomnia\n```\n\n## Usage\n\nTo use this plugin you must first require() it:\n\n#### JavaScript\n```js\nvar insomnia = require(\"@nativescript-community/insomnia\");\n```\n\n#### TypeScript\nYou could do the same as in JS, but this looks fancier, right?\n\n```typescript\nimport { keepAwake, allowSleepAgain } from \"@nativescript-community/insomnia\";\n```\n\n### keepAwake\n\n```typescript\n  insomnia.keepAwake().then(function() {\n      console.log(\"Insomnia is active\");\n  })\n```\n\n### allowSleepAgain\n\n```typescript\n  insomnia.allowSleepAgain().then(function() {\n      console.log(\"Insomnia is inactive, good night!\");\n  })\n```\n","funding_links":["https://github.com/sponsors/farfromrefug"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Finsomnia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnativescript-community%2Finsomnia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnativescript-community%2Finsomnia/lists"}