File tree 3 files changed +26
-42
lines changed
3 files changed +26
-42
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
# NativeScript Insomnia
2
2
3
- Make the screen not dim (and eventually lock the device) while Insomnia is active .
3
+ A plugin to make the screen not dim (and eventually lock the device).
4
4
5
5
## Installation
6
- From the command prompt go to your app's ` app ` folder and execute :
6
+ Run the following command from the root of your project :
7
7
8
8
```
9
- npm install nativescript-insomnia
9
+ tns plugin add nativescript-insomnia
10
10
```
11
11
12
12
## Usage
13
13
14
- ### keepAwake
14
+ To use this plugin you must first require() it:
15
15
16
16
``` js
17
- var insomnia = require ( " ./node_modules/nativescript-insomnia/insomnia" );
17
+ var insomnia = require (" nativescript-insomnia" );
18
+ ```
19
+
20
+ ### keepAwake
18
21
22
+ ``` js
19
23
insomnia .keepAwake ().then (function () {
20
24
console .log (" Insomnia is active" );
21
25
})
@@ -24,8 +28,6 @@ npm install nativescript-insomnia
24
28
### allowSleepAgain
25
29
26
30
``` js
27
- var insomnia = require ( " ./node_modules/nativescript-insomnia/insomnia" );
28
-
29
31
insomnia .allowSleepAgain ().then (function () {
30
32
console .log (" Insomnia is inactive, good night!" );
31
33
})
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " nativescript-insomnia" ,
3
- "version" : " 1.0 .0" ,
3
+ "version" : " 1.1 .0" ,
4
4
"description" : " Make the screen not dim (and eventually lock the device) while Insomnia is active" ,
5
5
"main" : " insomnia.js" ,
6
+ "nativescript" : {
7
+ "platforms" : {
8
+ "ios" : " 1.1.0" ,
9
+ "android" : " 1.1.0"
10
+ }
11
+ },
6
12
"repository" : {
7
13
"type" : " git" ,
8
14
"url" : " https://github.com/eddyverbruggen/nativescript-insomnia.git"
9
15
},
10
16
"keywords" : [
11
- " NativeScript"
17
+ " NativeScript" ,
18
+ " Insomnia" ,
19
+ " Screen dim" ,
20
+ " dim" ,
21
+ " lock" ,
22
+ " sleep"
12
23
],
13
- "author" : {
14
- "name" : " Eddy Verbruggen" ,
15
-
16
- "url" : " http://x-services.nl/"
17
- },
18
- "license" : {
19
- "type" : " MIT" ,
20
- "url" : " https://github.com/eddyverbruggen/nativescript-insomnia/blob/master/LICENSE"
21
- },
22
- "bugs" : {
23
- "url" : " https://github.com/eddyverbruggen/nativescript-insomnia/issues"
24
- },
25
- "homepage" : " https://github.com/eddyverbruggen/nativescript-insomnia" ,
26
- "readmeFilename" : " README.md"
24
+ "author" :
" Eddy Verbruggen <[email protected] > (https://github.com/EddyVerbruggen)" ,
25
+ "license" : " MIT" ,
26
+ "bugs" : " https://github.com/eddyverbruggen/nativescript-insomnia/issues" ,
27
+ "homepage" : " https://github.com/eddyverbruggen/nativescript-insomnia"
27
28
}
You can’t perform that action at this time.
0 commit comments