kernelsu 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +43 -0
  2. package/index.js +8 -0
  3. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Library for KernelSU's module WebUI
2
+
3
+ ## Install
4
+
5
+ ```sh
6
+ yarn add kernelsu
7
+ ```
8
+
9
+ ## API
10
+
11
+ ### exec
12
+
13
+ Execute a command in the **root** shell.
14
+
15
+ options:
16
+
17
+ - `cwd` - Current working directory of the child process
18
+ - `env` - Environment key-value pairs
19
+
20
+ ```javascript
21
+ import { exec } from 'kernelsu';
22
+
23
+ const { stdout, stderr } = await exec('ls -l', { cwd: '/tmp'});
24
+ console.log(stdout);
25
+ ```
26
+
27
+ ### fullScreen
28
+
29
+ Request the WebView enter/exit full screen.
30
+
31
+ ```javascript
32
+ import { fullScreen } from 'kernelsu';
33
+ fullScreen(true);
34
+ ```
35
+
36
+ ### toast
37
+
38
+ Show a toast message.
39
+
40
+ ```javascript
41
+ import { toast } from 'kernelsu';
42
+ toast('Hello, world!');
43
+ ```
package/index.js CHANGED
@@ -46,3 +46,11 @@ export function exec(command, options) {
46
46
  }
47
47
  });
48
48
  }
49
+
50
+ export function fullScreen(isFullScreen) {
51
+ ksu.fullScreen(isFullScreen);
52
+ }
53
+
54
+ export function toast(message) {
55
+ ksu.toast(message);
56
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kernelsu",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Library for KernelSU's module WebUI",
5
5
  "main": "index.js",
6
6
  "scripts": {