@nativescript-community/insomnia
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

NativeScript Insomnia

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

Demo app (Angular)

This plugin is part of the plugin showcase app I built using Angular.

Installation

Run the following command from the root of your project:

tns plugin add @nativescript-community/insomnia

Usage

To use this plugin you must first require() it:

JavaScript

var insomnia = require("@nativescript-community/insomnia");

TypeScript

You could do the same as in JS, but this looks fancier, right?

import { keepAwake, allowSleepAgain } from "@nativescript-community/insomnia";

keepAwake

  insomnia.keepAwake().then(function() {
      console.log("Insomnia is active");
  })

allowSleepAgain

  insomnia.allowSleepAgain().then(function() {
      console.log("Insomnia is inactive, good night!");
  })

/@nativescript-community/insomnia/

    Package Sidebar

    Install

    npm i @nativescript-community/insomnia

    Weekly Downloads

    115

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    5.67 kB

    Total Files

    10

    Last publish

    Collaborators

    • ammarahm-ed
    • dgmachado
    • classicoldsong
    • mayerlench
    • jcassidyav
    • sebjean
    • cjohn001
    • edusperoni
    • asharghi
    • farfromrefuge
    • triniwiz
    • eddyverbruggen
    • rigor789
    • walkerrunpdx
    • dnr
    • keerl
    • cvietor
    • bradmartin
    • rdlabo
    • tralves