Skip to content

Commit b304611

Browse files
committed
update docs, and version
1 parent b371b67 commit b304611

File tree

3 files changed

+61
-43
lines changed

3 files changed

+61
-43
lines changed

README.md

Lines changed: 55 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ This is mainly focused on initial installation of an Node JS packages that needs
1010

1111
`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.
1212

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.
1419

1520
## Install
1621

@@ -42,7 +47,7 @@ console.log('To fully install a `pandoc` package run: ' + sys.installer + ' pand
4247

4348
### Install `vim` package onto host, using system's default package manager
4449

45-
* Returns a `Promise`
50+
- *Returns* a `Promise`
4651

4752
```js
4853
import { installer } from 'node-sys';
@@ -63,7 +68,7 @@ installer('vim', onprogress)
6368
});
6469
```
6570

66-
## API - `spawning`(command, arguments, progressOptions, options)
71+
### API - `spawning`(command, arguments, progressOptions, options)
6772

6873
`import { spawning } from 'node-sys';`
6974

@@ -81,36 +86,47 @@ installer('vim', onprogress)
8186

8287
*The progress callback will receive an object with these properties:*
8388

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.
8691

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.
8994

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.
9297

9398
If there's an error running the child process, received data on stderr, or errors in progress callback, `spawning` rejects the returned promise.
9499

95-
### General type `check` functions
100+
### General *`strict`* type *`check`* functions
96101

97102
```js
98103
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
111116
} from 'node-sys';
112117
```
113118

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+
114130
### CLI Usage
115131

116132
```s
@@ -133,8 +149,8 @@ installing...
133149

134150
To install an System OS package manager.
135151

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**
138154

139155
```s
140156
$ node-sys -g | --get # or npm run get-installer
@@ -145,33 +161,33 @@ $ node-sys -g | --get # or npm run get-installer
145161

146162
### FreeBSD
147163

148-
* [pkg]
149-
* [pkg_add]
164+
- [pkg]
165+
- [pkg_add]
150166

151167
### Linux
152168

153-
* [apt-get] - Debian, Ubuntu
154-
* [dnf] - fedora
155-
* [emerge] - Gentoo
156-
* [nix] - NixOS
157-
* [pacman] - ArchLinux
158-
* [yum] - fedora
159-
* [zypper] - OpenSUSE
160-
* [chromebrew] - Chrome OS
169+
- [apt-get] - Debian, Ubuntu
170+
- [dnf] - fedora
171+
- [emerge] - Gentoo
172+
- [nix] - NixOS
173+
- [pacman] - ArchLinux
174+
- [yum] - fedora
175+
- [zypper] - OpenSUSE
176+
- [chromebrew] - Chrome OS
161177

162178
### OS X
163179

164-
* [brew]
165-
* [pkgin]
166-
* [port]
180+
- [brew]
181+
- [pkgin]
182+
- [port]
167183

168184
### Solaris
169185

170-
* [pkg](https://docs.oracle.com/cd/E23824_01/html/E21802/gihhp.html)
186+
- [pkg](https://docs.oracle.com/cd/E23824_01/html/E21802/gihhp.html)
171187

172188
### Windows
173189

174-
* [chocolatey]
190+
- [chocolatey]
175191

176192
[apt-get]: https://help.ubuntu.com/community/AptGet/Howto
177193
[brew]: http://brew.sh

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"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.",
55
"type": "module",
66
"main": "index.js",
77
"bin": {
@@ -46,7 +46,9 @@
4646
"spawn",
4747
"spawning",
4848
"child_process",
49-
"promisify"
49+
"promisify",
50+
"administrator",
51+
"sudo"
5052
],
5153
"author": "l. stubbs <[email protected]>",
5254
"contributors": [

0 commit comments

Comments
 (0)