JSPM

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

Prollyfill for child_process.spawnSync

Package Exports

  • spawn-sync

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 (spawn-sync) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

spawn-sync

Prollyfill for child_process.spawnSync

On platforms that support compiling native modules it uses the execSync module to get true synchronous execution. If native compilation is not supported it falls back to waiting for an output file to exist in a tight loop. In this way it gains excellent cross platform support, but don't expect it to be efficient on all platforms.

Build Status Dependency Status NPM version

Installation

npm install spawn-sync

Usage

var spawnSync = require('child_process').spawnSync || require('spawn-sync');

var result = spawnSync('node',
                       ['filename.js'],
                       {input: 'write this to stdin'});

// Note, status code will always equal 0 if using busy waiting fallback
if (result.statusCode !== 0) {
  process.stderr.write(result.stderr);
  process.exit(result.statusCode);
} else {
  process.stdout.write(result.stdout);
  process.stderr.write(result.stderr);
}

License

MIT