Skip to content

Latest commit

 

History

History
executable file
·
43 lines (31 loc) · 879 Bytes

File metadata and controls

executable file
·
43 lines (31 loc) · 879 Bytes

NativeScript Insomnia

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-insomnia

Usage

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

JavaScript

var insomnia = require("nativescript-insomnia");

TypeScript

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

const { keepAwake, allowSleepAgain } = require("nativescript-insomnia");

keepAwake

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

allowSleepAgain

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