Skip to content

😪 NativeScript plugin to keep the device awake (not dim the screen, lock, etc)

Notifications You must be signed in to change notification settings

andres2050/nativescript-insomnia

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!");
  })

About

😪 NativeScript plugin to keep the device awake (not dim the screen, lock, etc)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%