create-spawn

A simple package to handle child_process.spawn in a practical way

Usage no npm install needed!

<script type="module">
  import createSpawn from 'https://cdn.skypack.dev/create-spawn';
</script>

README

Create Spawn

A simple package to handle child_process.spawn in a practical way

Install

NPM

  • Use: require('create-spawn')
  • Install: npm install --save create-spawn

YARN

  • Use: require('create-spawn')
  • Install: yarn add create-spawn

Usage

Example


const createSpawn = require('create-spawn')

(() => {
  const { stdout, stderr } = createSpawn`
    echo ${'test test test'}
  `
  /*
    Or createSpawn('echo', ['test test test'])
  */

  stdout // Stream
  stderr // Stream


})()

Example 2


const createSpawn = require('create-spawn')

(async () => {
  const { stdout, stderr, all } = await createSpawn`
    echo ${'test test test'}
  `

  stdout // String
  stderr // String


})()

License

Licensed under permissive MIT license