JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2314794
  • Score
    100M100P100Q202613F
  • License MIT

Tiny process execution for humans — a better child_process

Package Exports

  • nano-spawn

Readme

nano-spawn logo

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.
  • execa - Process execution for humans
  • unicorn-magic - Slightly improved child_process#execFile