You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-39Lines changed: 55 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,12 @@ This is mainly focused on initial installation of an Node JS packages that needs
10
10
11
11
`node-sys` will try to find which system packaging is installed for the given `process.platform`. If no system package manager is found, `'No package manager found!'` is returned.
12
12
13
-
A `spawning` cross-platform version of Node's child_process.`spawn` that returns a **Promise**.
13
+
A `spawning` cross-platform version of Node's child_process.`spawn` that returns a **Promise**, with additions:
14
+
15
+
- easily execute as administrator, on `Windows` a pop up **UAC** window will appear.
16
+
- pass callbacks, for `stderr` and `stdout`**on**`data` events, any _returns_ will be the **reject/resolve** result.
17
+
-`fork` another **script**, a _Node Js_ module instance, for additional sub processing base on `stderr` or `stdout` events.
18
+
- pass additional callback for the `message` event.
*The progress callback will receive an object with these properties:*
83
88
84
-
*`spawn:`*Object* - Spawned child process instance handle.
85
-
* Access the child process object.
89
+
-`spawn:`*Object* - Spawned child process instance handle.
90
+
- Access the child process object.
86
91
87
-
*`output:`*String* - Output from stdout.
88
-
* Output can be altered and if returned will replace the otherwise resolved result.
92
+
-`output:`*String* - Output from stdout.
93
+
- Output can be altered and if returned will replace the otherwise resolved result.
89
94
90
-
*`fork:`*Object* - An additional [forked](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options) Node Js process handle, IPC communication channel.
91
-
* Execute additional processing base off of sub child process output, with module a script.
95
+
-`fork:`*Object* - An additional [forked](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options) Node Js process handle, IPC communication channel.
96
+
- Execute additional processing base off of sub child process output, with module a script.
92
97
93
98
If there's an error running the child process, received data on stderr, or errors in progress callback, `spawning` rejects the returned promise.
94
99
95
-
### General type `check` functions
100
+
### General *`strict`*type *`check`* functions
96
101
97
102
```js
98
103
import {
99
-
isArray,
100
-
isUndefined,
101
-
isBuffer,
102
-
isArrayBuffer,
103
-
isString,
104
-
isNumber,
105
-
isObject,
106
-
isObjectOnly,
107
-
isBlob,
108
-
isFunction,
109
-
isDate,
110
-
isStream
104
+
isArray,// True if value is an Array, otherwise false.
105
+
isUndefined,// True if the value is undefined, otherwise false.
106
+
isBuffer,// True if value is a Buffer, otherwise false.
107
+
isArrayBuffer,// True if value is an ArrayBuffer, otherwise false.
108
+
isString,// True if value is a String, otherwise false.
109
+
isNumber,// True if value is a Number, otherwise false.
110
+
isObject,// True if value is an Object, otherwise false.
111
+
isObjectOnly,// True if value is a `Object` only, otherwise false, not an Array, Function, or any other type.
112
+
isBlob,// True if value is a Blob, otherwise false.
113
+
isFunction,// True if value is a Function, otherwise false.
114
+
isDate,// True if value is a Date, otherwise false.
115
+
isStream//True if value is a Stream, otherwise false
111
116
} from'node-sys';
112
117
```
113
118
119
+
### Find any executable
120
+
121
+
The `sync` from [node-which](https://github.com/npm/node-which) has been exported to `where`.
122
+
123
+
```js
124
+
import { where } from'node-sys';
125
+
126
+
// Like the unix `which` utility, will be a `string`, or `null` for not found.
127
+
let found =where('node');
128
+
```
129
+
114
130
### CLI Usage
115
131
116
132
```s
@@ -133,8 +149,8 @@ installing...
133
149
134
150
To install an System OS package manager.
135
151
136
-
* Will install [chocolatey] for **Windows OS**
137
-
* Will install [brew] for **Apple macOS**
152
+
- Will install [chocolatey] for **Windows OS**
153
+
- Will install [brew] for **Apple macOS**
138
154
139
155
```s
140
156
$ node-sys -g | --get # or npm run get-installer
@@ -145,33 +161,33 @@ $ node-sys -g | --get # or npm run get-installer
Copy file name to clipboardExpand all lines: package.json
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "node-sys",
3
-
"version": "1.1.0",
4
-
"description": "Universal package installer, get the command for managing packages, or auto install any package, using one command for all platforms. Automate the installation of macOS Brew, and Windows Chocolatey package managers. A promisify child process of spawn.",
3
+
"version": "1.1.1",
4
+
"description": "Universal package installer, get the command for managing packages, or auto install any package, using one command for all platforms. Automate the installation of macOS Brew, and Windows Chocolatey package managers. A promisify child process of spawn, run as administrator.",
0 commit comments