@stdlib/utils-parallel 0.2.0 → 0.2.1

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.
package/README.md CHANGED
@@ -57,9 +57,11 @@ var parallel = require( '@stdlib/utils-parallel' );
57
57
 
58
58
  Executes scripts in parallel.
59
59
 
60
+ <!-- FIXME: revert back to JavaScript once can handle errors -->
61
+
60
62
  <!-- run-disable -->
61
63
 
62
- ```javascript
64
+ ```text
63
65
  var files = [
64
66
  './a.js',
65
67
  './b.js'
@@ -89,9 +91,11 @@ The function accepts the following `options`:
89
91
 
90
92
  By default, the number of workers running scripts is equal to the number of CPUs minus `1` (master process). To adjust the number of workers, set the `workers` option.
91
93
 
94
+ <!-- FIXME: revert back to JavaScript once can handle errors -->
95
+
92
96
  <!-- run-disable -->
93
97
 
94
- ```javascript
98
+ ```text
95
99
  var files = [
96
100
  './a.js',
97
101
  './b.js'
@@ -115,9 +119,11 @@ parallel( files, opts, done );
115
119
 
116
120
  By default, the number of scripts running concurrently is equal to the number of workers. To adjust the concurrency, set the `concurrency` option.
117
121
 
122
+ <!-- FIXME: revert back to JavaScript once can handle errors -->
123
+
118
124
  <!-- run-disable -->
119
125
 
120
- ```javascript
126
+ ```text
121
127
  var files = [
122
128
  './a.js',
123
129
  './b.js'
@@ -149,9 +155,11 @@ $ node <script_path>
149
155
 
150
156
  To run scripts via an alternative executable or none at all, set the `cmd` option.
151
157
 
158
+ <!-- FIXME: revert back to JavaScript once can handle errors -->
159
+
152
160
  <!-- run-disable -->
153
161
 
154
- ```javascript
162
+ ```text
155
163
  var files = [
156
164
  './a.js',
157
165
  './b.js'
@@ -175,9 +183,11 @@ parallel( files, opts, done );
175
183
 
176
184
  By default, the `stdio` output for each script is interleaved; i.e., the `stdio` output from one script **may** be interleaved with the `stdio` output from one or more other scripts. To preserve the `stdio` output order for each script, set the `ordered` option to `true`.
177
185
 
186
+ <!-- FIXME: revert back to JavaScript once can handle errors -->
187
+
178
188
  <!-- run-disable -->
179
189
 
180
- ```javascript
190
+ ```text
181
191
  var files = [
182
192
  './a.js',
183
193
  './b.js'
@@ -220,9 +230,11 @@ parallel( files, opts, done );
220
230
 
221
231
  ## Examples
222
232
 
233
+ <!-- FIXME: re-enable running of code block once able to set `maxBuffer` configuration -->
234
+
223
235
  <!-- run-disable -->
224
236
 
225
- <!-- FIXME: re-enable running of code block once able to set `maxBuffer` configuration -->
237
+ <!-- eslint-disable node/no-sync -->
226
238
 
227
239
  <!-- eslint no-undef: "error" -->
228
240
 
@@ -378,8 +390,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
378
390
  [npm-image]: http://img.shields.io/npm/v/@stdlib/utils-parallel.svg
379
391
  [npm-url]: https://npmjs.org/package/@stdlib/utils-parallel
380
392
 
381
- [test-image]: https://github.com/stdlib-js/utils-parallel/actions/workflows/test.yml/badge.svg?branch=v0.2.0
382
- [test-url]: https://github.com/stdlib-js/utils-parallel/actions/workflows/test.yml?query=branch:v0.2.0
393
+ [test-image]: https://github.com/stdlib-js/utils-parallel/actions/workflows/test.yml/badge.svg?branch=v0.2.1
394
+ [test-url]: https://github.com/stdlib-js/utils-parallel/actions/workflows/test.yml?query=branch:v0.2.1
383
395
 
384
396
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-parallel/main.svg
385
397
  [coverage-url]: https://codecov.io/github/stdlib-js/utils-parallel?branch=main
@@ -133,7 +133,7 @@ declare function parallel( files: Array<string>, clbk: Callback ): void;
133
133
  *
134
134
  * parallel( files, opts, done );
135
135
  */
136
- declare function parallel( files: Array<string>, options: Options, clbk: Callback ): void; // tslint-disable-line max-line-length
136
+ declare function parallel( files: Array<string>, options: Options, clbk: Callback ): void;
137
137
 
138
138
 
139
139
  // EXPORTS //
@@ -56,7 +56,7 @@ function onMessage( message ) {
56
56
  debug( 'Environment configuration allows interleaved script output.' );
57
57
  child = spawn( proc.env.WORKER_CMD, message, done );
58
58
  }
59
- db[ child.pid ] = true;
59
+ db[ child.pid ] = child;
60
60
  }
61
61
 
62
62
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/utils-parallel",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Execute scripts in parallel.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -39,17 +39,20 @@
39
39
  "url": "https://github.com/stdlib-js/stdlib/issues"
40
40
  },
41
41
  "dependencies": {
42
- "@stdlib/assert-has-own-property": "^0.1.0",
43
- "@stdlib/assert-is-boolean": "^0.1.0",
44
- "@stdlib/assert-is-function": "^0.1.0",
42
+ "@stdlib/assert-has-own-property": "^0.1.1",
43
+ "@stdlib/assert-is-boolean": "^0.1.1",
44
+ "@stdlib/assert-is-function": "^0.1.1",
45
45
  "@stdlib/assert-is-nonnegative-integer": "^0.1.0",
46
- "@stdlib/assert-is-plain-object": "^0.1.0",
46
+ "@stdlib/assert-is-plain-object": "^0.1.1",
47
47
  "@stdlib/assert-is-positive-integer": "^0.1.0",
48
- "@stdlib/assert-is-string": "^0.1.0",
49
- "@stdlib/assert-is-string-array": "^0.1.0",
50
- "@stdlib/os-num-cpus": "^0.1.0",
51
- "@stdlib/process-cwd": "^0.1.0",
52
- "@stdlib/string-format": "^0.1.0"
48
+ "@stdlib/assert-is-string": "^0.1.1",
49
+ "@stdlib/assert-is-string-array": "^0.1.1",
50
+ "@stdlib/os-num-cpus": "^0.1.1",
51
+ "@stdlib/process-cwd": "^0.1.1",
52
+ "@stdlib/process-env": "^0.1.1",
53
+ "@stdlib/string-format": "^0.1.1",
54
+ "@stdlib/utils-keys": "^0.1.0",
55
+ "debug": "^2.6.9"
53
56
  },
54
57
  "devDependencies": {
55
58
  "proxyquire": "^2.0.0",