Skip to content

Commit 2b444e6

Browse files
Transforming module into plugin
1 parent dc10aa9 commit 2b444e6

File tree

3 files changed

+26
-42
lines changed

3 files changed

+26
-42
lines changed

LICENSE

-19
This file was deleted.

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
# NativeScript Insomnia
22

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).
44

55
## 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:
77

88
```
9-
npm install nativescript-insomnia
9+
tns plugin add nativescript-insomnia
1010
```
1111

1212
## Usage
1313

14-
### keepAwake
14+
To use this plugin you must first require() it:
1515

1616
```js
17-
var insomnia = require( "./node_modules/nativescript-insomnia/insomnia" );
17+
var insomnia = require("nativescript-insomnia");
18+
```
19+
20+
### keepAwake
1821

22+
```js
1923
insomnia.keepAwake().then(function() {
2024
console.log("Insomnia is active");
2125
})
@@ -24,8 +28,6 @@ npm install nativescript-insomnia
2428
### allowSleepAgain
2529

2630
```js
27-
var insomnia = require( "./node_modules/nativescript-insomnia/insomnia" );
28-
2931
insomnia.allowSleepAgain().then(function() {
3032
console.log("Insomnia is inactive, good night!");
3133
})

package.json

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
{
22
"name": "nativescript-insomnia",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Make the screen not dim (and eventually lock the device) while Insomnia is active",
55
"main": "insomnia.js",
6+
"nativescript": {
7+
"platforms": {
8+
"ios": "1.1.0",
9+
"android": "1.1.0"
10+
}
11+
},
612
"repository": {
713
"type": "git",
814
"url": "https://github.com/eddyverbruggen/nativescript-insomnia.git"
915
},
1016
"keywords": [
11-
"NativeScript"
17+
"NativeScript",
18+
"Insomnia",
19+
"Screen dim",
20+
"dim",
21+
"lock",
22+
"sleep"
1223
],
13-
"author": {
14-
"name": "Eddy Verbruggen",
15-
"email": "[email protected]",
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"
2728
}

0 commit comments

Comments
 (0)