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
// Progress callback for any output doing installation.
51
+
// Any value returned in `callback` will be the final resolved output result.
52
+
constonprogress= (object) => {
53
+
console.log(object.output);
54
+
}
55
+
56
+
installer('vim', onprogress)
50
57
.then(function(data){
51
58
// returns installation output
52
59
console.log(data);
@@ -56,7 +63,9 @@ installer('vim')
56
63
});
57
64
```
58
65
59
-
## API - spawning(command, arguments, progressOptions, options)
66
+
## API - `spawning`(command, arguments, progressOptions, options)
67
+
68
+
`import { spawning } from 'node-sys';`
60
69
61
70
`Spawning` takes an additional argument, `progressOptions`, its [`options`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) are the same as those of `child_process.spawn` plus:
62
71
@@ -72,17 +81,36 @@ installer('vim')
72
81
73
82
*The progress callback will receive an object with these properties:*
74
83
75
-
*`handle:`*Object* - Spawned child process instance handler.
84
+
*`spawn:`*Object* - Spawned child process instance handle.
76
85
* Access the child process object.
77
86
78
87
*`output:`*String* - Output from stdout.
79
88
* Output can be altered and if returned will replace the otherwise resolved result.
80
89
81
-
*`fork:`*Object* - An additional [forked](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options) Node Js process handler, IPC communication channel.
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.
82
91
* Execute additional processing base off of sub child process output, with module a script.
83
92
84
93
If there's an error running the child process, received data on stderr, or errors in progress callback, `spawning` rejects the returned promise.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "node-sys",
3
-
"version": "1.0.6",
3
+
"version": "1.1.0",
4
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.",
0 commit comments