@stdlib/utils-parallel 0.0.7 → 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/CITATION.cff +30 -0
- package/LICENSE +0 -304
- package/NOTICE +1 -1
- package/README.md +50 -73
- package/dist/index.d.ts +3 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +7 -0
- package/docs/types/index.d.ts +2 -2
- package/lib/browser/index.js +1 -1
- package/lib/defaults.js +30 -18
- package/lib/index.js +2 -2
- package/lib/main.js +5 -5
- package/lib/node/exec.js +3 -2
- package/lib/node/worker/worker.js +1 -1
- package/lib/validate.js +9 -8
- package/package.json +17 -27
- package/bin/cli +0 -105
- package/docs/repl.txt +0 -68
- package/docs/types/test.ts +0 -164
- package/docs/usage.txt +0 -15
- package/etc/cli_opts.json +0 -23
package/CITATION.cff
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
title: stdlib
|
|
3
|
+
message: >-
|
|
4
|
+
If you use this software, please cite it using the
|
|
5
|
+
metadata from this file.
|
|
6
|
+
|
|
7
|
+
type: software
|
|
8
|
+
|
|
9
|
+
authors:
|
|
10
|
+
- name: The Stdlib Authors
|
|
11
|
+
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
+
|
|
13
|
+
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
+
url: https://stdlib.io
|
|
15
|
+
|
|
16
|
+
abstract: |
|
|
17
|
+
Standard library for JavaScript and Node.js.
|
|
18
|
+
|
|
19
|
+
keywords:
|
|
20
|
+
- JavaScript
|
|
21
|
+
- Node.js
|
|
22
|
+
- TypeScript
|
|
23
|
+
- standard library
|
|
24
|
+
- scientific computing
|
|
25
|
+
- numerical computing
|
|
26
|
+
- statistical computing
|
|
27
|
+
|
|
28
|
+
license: Apache-2.0 AND BSL-1.0
|
|
29
|
+
|
|
30
|
+
date-released: 2016
|
package/LICENSE
CHANGED
|
@@ -175,307 +175,3 @@
|
|
|
175
175
|
of your accepting any such warranty or additional liability.
|
|
176
176
|
|
|
177
177
|
END OF TERMS AND CONDITIONS
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
Boost Software License - Version 1.0 - August 17th, 2003
|
|
182
|
-
|
|
183
|
-
Permission is hereby granted, free of charge, to any person or organization
|
|
184
|
-
obtaining a copy of the software and accompanying documentation covered by this
|
|
185
|
-
license (the "Software") to use, reproduce, display, distribute, execute, and
|
|
186
|
-
transmit the Software, and to prepare derivative works of the Software, and to
|
|
187
|
-
permit third-parties to whom the Software is furnished to do so, all subject to
|
|
188
|
-
the following:
|
|
189
|
-
|
|
190
|
-
The copyright notices in the Software and this entire statement, including the
|
|
191
|
-
above license grant, this restriction and the following disclaimer, must be
|
|
192
|
-
included in all copies of the Software, in whole or in part, and all derivative
|
|
193
|
-
works of the Software, unless such copies or derivative works are solely in the
|
|
194
|
-
form of machine-executable object code generated by a source language processor.
|
|
195
|
-
|
|
196
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
197
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
198
|
-
FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
199
|
-
COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
|
|
200
|
-
OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
201
|
-
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
DEPENDENCIES
|
|
207
|
-
|
|
208
|
-
The library links against the following external libraries, which have their own
|
|
209
|
-
licenses:
|
|
210
|
-
|
|
211
|
-
* OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/
|
|
212
|
-
def146efed8d5908ea04e22668feeab7099599a0/LICENSE>
|
|
213
|
-
|
|
214
|
-
Copyright (c) 2011-2014, The OpenBLAS Project
|
|
215
|
-
All rights reserved.
|
|
216
|
-
|
|
217
|
-
Redistribution and use in source and binary forms, with or without
|
|
218
|
-
modification, are permitted provided that the following conditions are
|
|
219
|
-
met:
|
|
220
|
-
|
|
221
|
-
1. Redistributions of source code must retain the above copyright
|
|
222
|
-
notice, this list of conditions and the following disclaimer.
|
|
223
|
-
|
|
224
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
225
|
-
notice, this list of conditions and the following disclaimer in
|
|
226
|
-
the documentation and/or other materials provided with the
|
|
227
|
-
distribution.
|
|
228
|
-
|
|
229
|
-
3. Neither the name of the OpenBLAS project nor the names of
|
|
230
|
-
its contributors may be used to endorse or promote products
|
|
231
|
-
derived from this software without specific prior written
|
|
232
|
-
permission.
|
|
233
|
-
|
|
234
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
235
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
236
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
237
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
238
|
-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
239
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
240
|
-
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
241
|
-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
242
|
-
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
243
|
-
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* Electron <https://raw.githubusercontent.com/electron/electron/
|
|
247
|
-
c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE>
|
|
248
|
-
|
|
249
|
-
Copyright (c) 2013-2017 GitHub Inc.
|
|
250
|
-
|
|
251
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
252
|
-
a copy of this software and associated documentation files (the
|
|
253
|
-
"Software"), to deal in the Software without restriction, including
|
|
254
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
255
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
256
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
257
|
-
the following conditions:
|
|
258
|
-
|
|
259
|
-
The above copyright notice and this permission notice shall be
|
|
260
|
-
included in all copies or substantial portions of the Software.
|
|
261
|
-
|
|
262
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
263
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
264
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
265
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
266
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
267
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
268
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
* Boost <http://www.boost.org/LICENSE_1_0.txt>
|
|
272
|
-
|
|
273
|
-
Boost Software License - Version 1.0 - August 17th, 2003
|
|
274
|
-
|
|
275
|
-
Permission is hereby granted, free of charge, to any person or organization
|
|
276
|
-
obtaining a copy of the software and accompanying documentation covered by
|
|
277
|
-
this license (the "Software") to use, reproduce, display, distribute,
|
|
278
|
-
execute, and transmit the Software, and to prepare derivative works of the
|
|
279
|
-
Software, and to permit third-parties to whom the Software is furnished to
|
|
280
|
-
do so, all subject to the following:
|
|
281
|
-
|
|
282
|
-
The copyright notices in the Software and this entire statement, including
|
|
283
|
-
the above license grant, this restriction and the following disclaimer,
|
|
284
|
-
must be included in all copies of the Software, in whole or in part, and
|
|
285
|
-
all derivative works of the Software, unless such copies or derivative
|
|
286
|
-
works are solely in the form of machine-executable object code generated by
|
|
287
|
-
a source language processor.
|
|
288
|
-
|
|
289
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
290
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
291
|
-
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
|
292
|
-
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
|
293
|
-
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
|
294
|
-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
295
|
-
DEALINGS IN THE SOFTWARE.
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
* Cephes <http://www.netlib.org/cephes/readme>
|
|
299
|
-
|
|
300
|
-
Copyright (c) 1984-2000 Stephen L. Moshier
|
|
301
|
-
|
|
302
|
-
Some software in this archive may be from the book _Methods and Programs for
|
|
303
|
-
Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989)
|
|
304
|
-
or from the Cephes Mathematical Library, a commercial product. In either event,
|
|
305
|
-
it is copyrighted by the author. What you see here may be used freely but it
|
|
306
|
-
comes with no support or guarantee.
|
|
307
|
-
|
|
308
|
-
Stephen L. Moshier
|
|
309
|
-
moshier@na-net.ornl.gov
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
ATTRIBUTION
|
|
314
|
-
|
|
315
|
-
The library contains implementations from the following external libraries,
|
|
316
|
-
which have their own licenses:
|
|
317
|
-
|
|
318
|
-
* FreeBSD <https://svnweb.freebsd.org/>
|
|
319
|
-
|
|
320
|
-
Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved.
|
|
321
|
-
|
|
322
|
-
Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
323
|
-
Permission to use, copy, modify, and distribute this
|
|
324
|
-
software is freely granted, provided that this notice
|
|
325
|
-
is preserved.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
* FDLIBM <http://www.netlib.org/fdlibm/>
|
|
329
|
-
|
|
330
|
-
Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved.
|
|
331
|
-
|
|
332
|
-
Developed at SunPro, a Sun Microsystems, Inc. business.
|
|
333
|
-
Permission to use, copy, modify, and distribute this
|
|
334
|
-
software is freely granted, provided that this notice
|
|
335
|
-
is preserved.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
* Go <https://raw.githubusercontent.com/golang/go/master/LICENSE>
|
|
339
|
-
|
|
340
|
-
Copyright (c) 2009 The Go Authors. All rights reserved.
|
|
341
|
-
|
|
342
|
-
Redistribution and use in source and binary forms, with or without
|
|
343
|
-
modification, are permitted provided that the following conditions are
|
|
344
|
-
met:
|
|
345
|
-
|
|
346
|
-
* Redistributions of source code must retain the above copyright
|
|
347
|
-
notice, this list of conditions and the following disclaimer.
|
|
348
|
-
* Redistributions in binary form must reproduce the above
|
|
349
|
-
copyright notice, this list of conditions and the following disclaimer
|
|
350
|
-
in the documentation and/or other materials provided with the
|
|
351
|
-
distribution.
|
|
352
|
-
* Neither the name of Google Inc. nor the names of its
|
|
353
|
-
contributors may be used to endorse or promote products derived from
|
|
354
|
-
this software without specific prior written permission.
|
|
355
|
-
|
|
356
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
357
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
358
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
359
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
360
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
361
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
362
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
363
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
364
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
365
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
366
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
* SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/>
|
|
370
|
-
|
|
371
|
-
Public domain.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
* ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE>
|
|
375
|
-
|
|
376
|
-
Copyright JS Foundation and other contributors, https://js.foundation
|
|
377
|
-
|
|
378
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
379
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
380
|
-
in the Software without restriction, including without limitation the rights
|
|
381
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
382
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
383
|
-
furnished to do so, subject to the following conditions:
|
|
384
|
-
|
|
385
|
-
The above copyright notice and this permission notice shall be included in
|
|
386
|
-
all copies or substantial portions of the Software.
|
|
387
|
-
|
|
388
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
389
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
390
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
391
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
392
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
393
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
394
|
-
THE SOFTWARE.
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
* StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/
|
|
398
|
-
e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md>
|
|
399
|
-
|
|
400
|
-
Copyright (c) 2015: Dahua Lin.
|
|
401
|
-
|
|
402
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
403
|
-
a copy of this software and associated documentation files (the
|
|
404
|
-
"Software"), to deal in the Software without restriction, including
|
|
405
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
406
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
407
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
408
|
-
the following conditions:
|
|
409
|
-
|
|
410
|
-
The above copyright notice and this permission notice shall be
|
|
411
|
-
included in all copies or substantial portions of the Software.
|
|
412
|
-
|
|
413
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
414
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
415
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
416
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
417
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
418
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
419
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
* SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/
|
|
423
|
-
SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE>
|
|
424
|
-
|
|
425
|
-
The MIT License (MIT)
|
|
426
|
-
|
|
427
|
-
Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others:
|
|
428
|
-
|
|
429
|
-
https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors
|
|
430
|
-
|
|
431
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
432
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
433
|
-
in the Software without restriction, including without limitation the rights
|
|
434
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
435
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
436
|
-
furnished to do so, subject to the following conditions:
|
|
437
|
-
|
|
438
|
-
The above copyright notice and this permission notice shall be included in all
|
|
439
|
-
copies or substantial portions of the Software.
|
|
440
|
-
|
|
441
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
442
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
443
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
444
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
445
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
446
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
447
|
-
SOFTWARE.
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
* MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/
|
|
451
|
-
mt19937ar.c>
|
|
452
|
-
|
|
453
|
-
Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
|
|
454
|
-
All rights reserved.
|
|
455
|
-
|
|
456
|
-
Redistribution and use in source and binary forms, with or without
|
|
457
|
-
modification, are permitted provided that the following conditions
|
|
458
|
-
are met:
|
|
459
|
-
|
|
460
|
-
1. Redistributions of source code must retain the above copyright
|
|
461
|
-
notice, this list of conditions and the following disclaimer.
|
|
462
|
-
|
|
463
|
-
2. Redistributions in binary form must reproduce the above copyright
|
|
464
|
-
notice, this list of conditions and the following disclaimer in the
|
|
465
|
-
documentation and/or other materials provided with the distribution.
|
|
466
|
-
|
|
467
|
-
3. The names of its contributors may not be used to endorse or promote
|
|
468
|
-
products derived from this software without specific prior written
|
|
469
|
-
permission.
|
|
470
|
-
|
|
471
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
472
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
473
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
474
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
475
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
476
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
477
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
478
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
479
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
480
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
481
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2023 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -18,6 +18,17 @@ limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
-->
|
|
20
20
|
|
|
21
|
+
|
|
22
|
+
<details>
|
|
23
|
+
<summary>
|
|
24
|
+
About stdlib...
|
|
25
|
+
</summary>
|
|
26
|
+
<p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
|
|
27
|
+
<p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
|
|
28
|
+
<p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
|
|
29
|
+
<p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
|
|
30
|
+
</details>
|
|
31
|
+
|
|
21
32
|
# Parallel
|
|
22
33
|
|
|
23
34
|
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
@@ -46,9 +57,11 @@ var parallel = require( '@stdlib/utils-parallel' );
|
|
|
46
57
|
|
|
47
58
|
Executes scripts in parallel.
|
|
48
59
|
|
|
60
|
+
<!-- FIXME: revert back to JavaScript once can handle errors -->
|
|
61
|
+
|
|
49
62
|
<!-- run-disable -->
|
|
50
63
|
|
|
51
|
-
```
|
|
64
|
+
```text
|
|
52
65
|
var files = [
|
|
53
66
|
'./a.js',
|
|
54
67
|
'./b.js'
|
|
@@ -78,9 +91,11 @@ The function accepts the following `options`:
|
|
|
78
91
|
|
|
79
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.
|
|
80
93
|
|
|
94
|
+
<!-- FIXME: revert back to JavaScript once can handle errors -->
|
|
95
|
+
|
|
81
96
|
<!-- run-disable -->
|
|
82
97
|
|
|
83
|
-
```
|
|
98
|
+
```text
|
|
84
99
|
var files = [
|
|
85
100
|
'./a.js',
|
|
86
101
|
'./b.js'
|
|
@@ -104,9 +119,11 @@ parallel( files, opts, done );
|
|
|
104
119
|
|
|
105
120
|
By default, the number of scripts running concurrently is equal to the number of workers. To adjust the concurrency, set the `concurrency` option.
|
|
106
121
|
|
|
122
|
+
<!-- FIXME: revert back to JavaScript once can handle errors -->
|
|
123
|
+
|
|
107
124
|
<!-- run-disable -->
|
|
108
125
|
|
|
109
|
-
```
|
|
126
|
+
```text
|
|
110
127
|
var files = [
|
|
111
128
|
'./a.js',
|
|
112
129
|
'./b.js'
|
|
@@ -138,9 +155,11 @@ $ node <script_path>
|
|
|
138
155
|
|
|
139
156
|
To run scripts via an alternative executable or none at all, set the `cmd` option.
|
|
140
157
|
|
|
158
|
+
<!-- FIXME: revert back to JavaScript once can handle errors -->
|
|
159
|
+
|
|
141
160
|
<!-- run-disable -->
|
|
142
161
|
|
|
143
|
-
```
|
|
162
|
+
```text
|
|
144
163
|
var files = [
|
|
145
164
|
'./a.js',
|
|
146
165
|
'./b.js'
|
|
@@ -164,9 +183,11 @@ parallel( files, opts, done );
|
|
|
164
183
|
|
|
165
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`.
|
|
166
185
|
|
|
186
|
+
<!-- FIXME: revert back to JavaScript once can handle errors -->
|
|
187
|
+
|
|
167
188
|
<!-- run-disable -->
|
|
168
189
|
|
|
169
|
-
```
|
|
190
|
+
```text
|
|
170
191
|
var files = [
|
|
171
192
|
'./a.js',
|
|
172
193
|
'./b.js'
|
|
@@ -209,9 +230,11 @@ parallel( files, opts, done );
|
|
|
209
230
|
|
|
210
231
|
## Examples
|
|
211
232
|
|
|
233
|
+
<!-- FIXME: re-enable running of code block once able to set `maxBuffer` configuration -->
|
|
234
|
+
|
|
212
235
|
<!-- run-disable -->
|
|
213
236
|
|
|
214
|
-
<!--
|
|
237
|
+
<!-- eslint-disable node/no-sync -->
|
|
215
238
|
|
|
216
239
|
<!-- eslint no-undef: "error" -->
|
|
217
240
|
|
|
@@ -311,69 +334,16 @@ parallel( files, opts, done );
|
|
|
311
334
|
|
|
312
335
|
<!-- /.examples -->
|
|
313
336
|
|
|
314
|
-
* * *
|
|
315
|
-
|
|
316
|
-
<section class="cli">
|
|
317
|
-
|
|
318
|
-
## CLI
|
|
319
|
-
|
|
320
|
-
<section class="installation">
|
|
321
|
-
|
|
322
|
-
## Installation
|
|
323
|
-
|
|
324
|
-
To use the module as a general utility, install the module globally
|
|
325
|
-
|
|
326
|
-
```bash
|
|
327
|
-
npm install -g @stdlib/utils-parallel
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
</section>
|
|
331
|
-
|
|
332
|
-
<!-- CLI usage documentation. -->
|
|
333
|
-
|
|
334
|
-
<section class="usage">
|
|
335
337
|
|
|
336
|
-
### Usage
|
|
337
338
|
|
|
338
|
-
|
|
339
|
-
Usage: parallel [options] <script1> <script2> ...
|
|
340
|
-
|
|
341
|
-
Options:
|
|
342
|
-
|
|
343
|
-
-h, --help Print this message.
|
|
344
|
-
-V, --version Print the package version.
|
|
345
|
-
--cmd cmd Executable file/command.
|
|
346
|
-
--workers num Number of workers.
|
|
347
|
-
--concurrency num Number of scripts to run concurrently.
|
|
348
|
-
--ordered Preserve order of script output.
|
|
349
|
-
--uid uid Process user identity.
|
|
350
|
-
--gid gid Process group identity.
|
|
351
|
-
--maxbuffer size Max buffer size for stdout and stderr.
|
|
352
|
-
```
|
|
353
|
-
|
|
354
|
-
</section>
|
|
355
|
-
|
|
356
|
-
<!-- /.usage -->
|
|
357
|
-
|
|
358
|
-
<section class="examples">
|
|
359
|
-
|
|
360
|
-
### Examples
|
|
361
|
-
|
|
362
|
-
```bash
|
|
363
|
-
$ parallel --cmd 'node' --workers 4 --concurrency 8 ./1.js ./2.js ./3.js ./4.js ./5.js ./6.js ./7.js ./8.js ./9.js ./10.js
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
</section>
|
|
367
|
-
|
|
368
|
-
<!-- /.examples -->
|
|
339
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
369
340
|
|
|
370
|
-
|
|
341
|
+
<section class="related">
|
|
371
342
|
|
|
372
|
-
|
|
343
|
+
## See Also
|
|
373
344
|
|
|
374
|
-
|
|
345
|
+
- <span class="package-name">[`@stdlib/utils-parallel-cli`][@stdlib/utils-parallel-cli]</span><span class="delimiter">: </span><span class="description">CLI package for use as a command-line utility.</span>
|
|
375
346
|
|
|
376
|
-
<section class="related">
|
|
377
347
|
|
|
378
348
|
</section>
|
|
379
349
|
|
|
@@ -405,7 +375,7 @@ See [LICENSE][stdlib-license].
|
|
|
405
375
|
|
|
406
376
|
## Copyright
|
|
407
377
|
|
|
408
|
-
Copyright © 2016-
|
|
378
|
+
Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
409
379
|
|
|
410
380
|
</section>
|
|
411
381
|
|
|
@@ -415,11 +385,13 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
415
385
|
|
|
416
386
|
<section class="links">
|
|
417
387
|
|
|
388
|
+
[@stdlib/utils-parallel-cli]: https://www.npmjs.com/package/@stdlib/utils-parallel-cli
|
|
389
|
+
|
|
418
390
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/utils-parallel.svg
|
|
419
391
|
[npm-url]: https://npmjs.org/package/@stdlib/utils-parallel
|
|
420
392
|
|
|
421
|
-
[test-image]: https://github.com/stdlib-js/utils-parallel/actions/workflows/test.yml/badge.svg
|
|
422
|
-
[test-url]: https://github.com/stdlib-js/utils-parallel/actions/workflows/test.yml
|
|
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
|
|
423
395
|
|
|
424
396
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/utils-parallel/main.svg
|
|
425
397
|
[coverage-url]: https://codecov.io/github/stdlib-js/utils-parallel?branch=main
|
|
@@ -431,19 +403,24 @@ Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
|
431
403
|
|
|
432
404
|
-->
|
|
433
405
|
|
|
406
|
+
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
407
|
+
[chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
|
|
408
|
+
|
|
409
|
+
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
410
|
+
|
|
411
|
+
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
412
|
+
|
|
413
|
+
[cli-section]: https://github.com/stdlib-js/utils-parallel#cli
|
|
414
|
+
[cli-url]: https://github.com/stdlib-js/utils-parallel/tree/cli
|
|
415
|
+
[@stdlib/utils-parallel]: https://github.com/stdlib-js/utils-parallel/tree/main
|
|
416
|
+
|
|
434
417
|
[umd]: https://github.com/umdjs/umd
|
|
435
418
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
436
419
|
|
|
437
420
|
[deno-url]: https://github.com/stdlib-js/utils-parallel/tree/deno
|
|
438
421
|
[umd-url]: https://github.com/stdlib-js/utils-parallel/tree/umd
|
|
439
422
|
[esm-url]: https://github.com/stdlib-js/utils-parallel/tree/esm
|
|
440
|
-
|
|
441
|
-
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
442
|
-
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
443
|
-
|
|
444
|
-
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
445
|
-
|
|
446
|
-
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
423
|
+
[branches-url]: https://github.com/stdlib-js/utils-parallel/blob/main/branches.md
|
|
447
424
|
|
|
448
425
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/utils-parallel/main/LICENSE
|
|
449
426
|
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var p=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var B=p(function(Rr,T){
|
|
2
|
+
var R=require('@stdlib/os-num-cpus/dist');function $(){return{workers:R-1,concurrency:R-1,cmd:"node",ordered:!1,uid:null,gid:null,encoding:"buffer",maxBuffer:200*1024*1024}}T.exports=$
|
|
3
|
+
});var K=p(function(Tr,I){
|
|
4
|
+
var rr=require('@stdlib/assert-is-plain-object/dist'),w=require('@stdlib/assert-has-own-property/dist'),_=require('@stdlib/assert-is-positive-integer/dist').isPrimitive,E=require('@stdlib/assert-is-nonnegative-integer/dist').isPrimitive,er=require('@stdlib/assert-is-boolean/dist').isPrimitive,ir=require('@stdlib/assert-is-string/dist').isPrimitive,v=require('@stdlib/error-tools-fmtprodmsg/dist');function nr(e,r){return rr(r)?w(r,"concurrency")&&(e.concurrency=r.concurrency,!_(e.concurrency))?new TypeError(v('1WZ3P',"concurrency",e.concurrency)):w(r,"workers")&&(e.workers=r.workers,!_(e.workers))?new TypeError(v('1WZ3P',"workers",e.workers)):w(r,"cmd")&&(e.cmd=r.cmd,!ir(e.cmd))?new TypeError(v('1WZ2W',"cmd",e.cmd)):w(r,"ordered")&&(e.ordered=r.ordered,!er(e.ordered))?new TypeError(v('1WZ2o',"ordered",e.ordered)):w(r,"uid")&&(e.uid=r.uid,!E(e.uid))?new TypeError(v('1WZ2t',"uid",e.uid)):w(r,"gid")&&(e.gid=r.gid,!E(e.gid))?new TypeError(v('1WZ2t',"gid",e.gid)):w(r,"maxBuffer")&&(e.maxBuffer=r.maxBuffer,!E(e.maxBuffer))?new TypeError(v('1WZ2t',"maxBuffer",e.maxBuffer)):null:new TypeError(v('1WZ2V',r));}I.exports=nr
|
|
5
|
+
});var W=p(function(Br,D){
|
|
6
|
+
var tr=require('@stdlib/utils-keys/dist'),P=require('@stdlib/process-env/dist');function ur(){var e,r,a,o;for(e=tr(P),a={},o=0;o<e.length;o++)r=e[o],a[r]=P[r];return a}function dr(e){var r=ur();return r.WORKER_CMD=e.cmd,r.WORKER_ENCODING=e.encoding,r.WORKER_MAX_BUFFER=e.maxBuffer,e.ordered&&(r.WORKER_ORDERED="1"),e.uid&&(r.WORKER_UID=e.uid),e.gid&&(r.WORKER_GID=e.gid),r}D.exports=dr
|
|
7
|
+
});var j=p(function(_r,N){
|
|
8
|
+
var ar=require('@stdlib/process-cwd/dist'),or=W();function cr(e){var r={cwd:ar(),env:or(e),stdio:"inherit"};return e.uid&&(r.uid=e.uid),e.gid&&(r.gid=e.gid),r}N.exports=cr
|
|
9
|
+
});var A=p(function(Ir,S){
|
|
10
|
+
var sr=require("child_process").fork,fr=require("path"),vr=require("debug"),O=require('@stdlib/utils-keys/dist'),F=require('@stdlib/error-tools-fmtprodmsg/dist'),lr=j(),u=vr("parallel:exec"),gr=fr.resolve(__dirname,"./worker/index.js");function mr(e,r,a){var o,c,l,f,y,d,x,k,g,h,m;for(u("Options: %s.",JSON.stringify(r)),o=0,u("Creating %d workers...",r.workers),c={},y=[],f=lr(r),m=0;m<r.workers;m++)u("Creating child process..."),d=sr(gr,y,f),d.on("error",Y(d)),d.on("close",L(d)),d.on("exit",z(d)),d.on("disconnect",Q(d)),d.on("message",J(d)),u("Child process created. pid: %d.",d.pid),c[d.pid]=d;for(x=O(c),u("%d workers created.",x.length),u("Running %d scripts concurrently...",r.concurrency),l={},g=-1,m=0;m<r.concurrency;m++)k=x[m%x.length],b(c[k]);function b(n){var t;if(g+=1,g>=e.length){if(t=O(l).length,t>0){u("%d scripts are pending.",t);return}return u("All scripts have finished."),q()}u("Instructing child process to run script: %s. pid: %d.",e[g],n.pid),n.send(e[g]),l[e[g]]=!0,u("%d of %d scripts have been processed.",g,e.length)}function J(n){return t;function t(i){u("Child process message: %s. pid: %d.",i,n.pid),delete l[i],b(n)}}function L(n){return t;function t(i,s){u("Child process closed. Code: %d. Signal: %s. pid: %d.",i,s,n.pid),C(i,s),X()}}function X(){o+=1,u("%d of %d child processes have closed.",o,r.workers),o===r.workers&&Z()}function z(n){return t;function t(i,s){u("Child process exited. Code: %d. Signal: %s. pid: %d.",i,s,n.pid),C(i,s)}}function q(n){var t,i,s;for(n&&!h&&(h=n),u("Instructing child processes to close..."),t=O(c),s=0;s<t.length;s++)i=t[s],u("Instructing child process (pid: %d) to close...",i),c[i].send("close")}function Q(n){return t;function t(){u("Child process disconnected. pid: %d.",n.pid)}}function Y(n){return t;function t(i){u("Child process error: %s. pid: %d.",i.message,n.pid),q(i)}}function C(n,t){var i;if(!h&&(n!==null&&n!==0?i=new Error(F('1WZBi',n)):t!==null&&(i=new Error(F('1WZBj',t))),i))return i.code=n,i.signal=t,q(i)}function Z(){if(h)return a(h);a()}}S.exports=mr
|
|
11
|
+
});var M=p(function(Kr,V){
|
|
12
|
+
var pr=A();V.exports=pr
|
|
13
|
+
});var H=p(function(Pr,G){
|
|
14
|
+
var wr=require("path"),hr=require('@stdlib/assert-is-string-array/dist').primitives,yr=require('@stdlib/assert-is-function/dist'),U=require('@stdlib/error-tools-fmtprodmsg/dist'),xr=require('@stdlib/process-cwd/dist'),qr=B(),Er=K(),Or=M();function kr(){var e,r,a,o,c,l,f;if(r=arguments[0],!hr(r))throw new TypeError(U('1WZ3s',r));if(r=r.slice(),a=qr(),arguments.length>2){if(e=arguments[1],o=arguments[2],c=Er(a,e),c)throw c}else o=arguments[1];if(!yr(o))throw new TypeError(U('1WZ2b',o));for(a.concurrency>r.length&&(a.concurrency=r.length),a.workers>a.concurrency&&(a.workers=a.concurrency),l=xr(),f=0;f<r.length;f++)r[f]=wr.resolve(l,r[f]);Or(r,a,y);function y(d){if(d)return o(d);o()}}G.exports=kr
|
|
15
|
+
});var br=H();module.exports=br;
|
|
16
|
+
/** @license Apache-2.0 */
|
|
17
|
+
//# sourceMappingURL=index.js.map
|