Package Exports
- nano-spawn
Readme
Tiny process execution for humans — a better
child_process
[!WARNING] This package is still a work in progress.
Check out execa
for more features.
Features
- Outputs combined result of stdout and stderr, similar to what you get in terminals
- Outputs lines
- No dependencies
Install
npm install nano-spawn
Usage
import $ from 'nano-spawn';
const result = await $('echo', ['🦄']);
console.log(result.exitCode);
//=> 0
import $ from 'nano-spawn';
for await (const line of $('ls', ['--oneline'])) {
console.log(line);
}
//=> index.d.ts
//=> index.js
//=> …
API
See the types for now.
Limitations
- It does not handle binary output. Use
execa
for that.
Related
- execa - Process execution for humans
- unicorn-magic - Slightly improved
child_process#execFile