Run binaries from node, with easy stdout/stderr manipulation + signal passthrough + exit code propagation.
npm install process-wrapper🌯 Run binaries from node, with easy stdout/stderr manipulation + signal passthrough + exit code propagation.
Useful for building wrappers that affect the behaviour of CLI programs, for example by changing their output format.
``ts
import spawnWrapped from 'process-wrapper';
// All arguments and signals are automatically are passed through.
// If the spawned command exits, this process will too with the same status code.
// 'line' is a line printed to an output stream. It includes the line terminator at the end.
spawnWrapped("some-cli", {
mapStdout: (line) => "my stdout: " + line,
mapStderr: (line) => "my stderr: " + line,
});
`
Pull requests are welcomed on GitHub! To get started:
1. Install Git and Node.js
2. Clone the repository
3. Install dependencies with npm installnpm run test
4. Run to run testsnpm run build
5. Build with
Versions follow the semantic versioning spec.
To release:
1. Use npm version to bump the versiongit push --follow-tags` to push with tags
2. Run
3. Wait for GitHub Actions to publish to the NPM registry.