https://github.com/oresoftware/generic-subshell
Bash API and Node.js interface for running dynamic number of subshells in parallel and collecting all exit codes.
https://github.com/oresoftware/generic-subshell
bash bash-script bash-scripting generic nodejs parallelism shell shell-script subshell
Last synced: 2 months ago
JSON representation
Bash API and Node.js interface for running dynamic number of subshells in parallel and collecting all exit codes.
- Host: GitHub
- URL: https://github.com/oresoftware/generic-subshell
- Owner: ORESoftware
- License: mit
- Created: 2017-02-18T22:56:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-30T04:19:30.000Z (about 7 years ago)
- Last Synced: 2025-02-12T10:05:05.994Z (4 months ago)
- Topics: bash, bash-script, bash-scripting, generic, nodejs, parallelism, shell, shell-script, subshell
- Language: JavaScript
- Homepage:
- Size: 2.7 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Generic-Subshell
Run a dynamic number of bash commands in parallel, collect all exit codes.
### This project essentially has two interfaces.
1. You can interact with the shell script directly. Using NPM, install this project.* Then reference the script with:
./node_modules/generic-subshell/lib/run.sh. Or just copy and paste the script in your project and make it your own :)2. There is a Node.js interface - pass the Node.js interface an array of commands, and this library will return with
a reference to the child process.```js
import * as gs from 'generic-subshell'; // using es5 it's: const gs = require('generic-subshell');
const commands = [
'echo "foo"',
'echo "baz"',
'echo "bar"'
];const k = gs.run(commands); // returns a child process
k.once('exit', function(code){
// if code is 0, all subshells exited with code 0
// if code is 1, at least one subshell exited with an non-zero code
});```
# Installation:
```bash
npm install generic-subshell --save```