A plugin to make the screen not dim (and eventually lock the device).
Run the following command from the root of your project:
tns plugin add nativescript-insomnia
To use this plugin you must first require() it:
var insomnia = require("nativescript-insomnia");
insomnia.keepAwake().then(function() {
console.log("Insomnia is active");
})
insomnia.allowSleepAgain().then(function() {
console.log("Insomnia is inactive, good night!");
})