JSPM

  • Created
  • Published
  • Downloads 96145913
  • Score
    100M100P100Q242570F
  • License MIT

A better child_process.{execFile,exec}

Package Exports

  • execa

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (execa) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

execa Build Status

A better child_process.{execFile,exec}

Why

Install

$ npm install --save execa

Usage

const execa = require('execa');

execa('echo', ['unicorns']).then(result => {
    console.log(result.stdout);
    //=> 'unicorns'
});

execa.shell('echo unicorns').then(result => {
    console.log(result.stdout);
    //=> 'unicorns'
});

API

execa(file, [arguments], [options])

Execute a file directly.

Same options as child_process.execFile.

Returns a promise for a result object with stdout and stderr properties.

execa.shell(command, [options])

Execute a command through the system shell. Prefer execa() whenever possible, as it's both faster and safer.

Same options as child_process.exec.

Returns a promise for a result object with stdout and stderr properties.

options

Additional exposed options:

stripEof

Type: boolean
Default: true

Strip EOF (last newline) from the output.

License

MIT © Sindre Sorhus