Sha256: b8e01cb18ba87ee1b0e5eb2eb1ce6cbb25a2bdd229f9e08671f8a10ed7e3ad35

Contents?: true

Size: 1.16 KB

Versions: 138

Compression:

Stored size: 1.16 KB

Contents

'use strict';

const cp = require('child_process');
const parse = require('./lib/parse');
const enoent = require('./lib/enoent');

function spawn(command, args, options) {
    // Parse the arguments
    const parsed = parse(command, args, options);

    // Spawn the child process
    const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);

    // Hook into child process "exit" event to emit an error if the command
    // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
    enoent.hookChildProcess(spawned, parsed);

    return spawned;
}

function spawnSync(command, args, options) {
    // Parse the arguments
    const parsed = parse(command, args, options);

    // Spawn the child process
    const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);

    // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
    result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);

    return result;
}

module.exports = spawn;
module.exports.spawn = spawn;
module.exports.sync = spawnSync;

module.exports._parse = parse;
module.exports._enoent = enoent;

Version data entries

138 entries across 136 versions & 16 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.50 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.49 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.48 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.47 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.46 node_modules/cross-spawn/index.js
pcp-server-ruby-sdk-0.0.6 node_modules/cross-spawn/index.js
pcp-server-ruby-sdk-0.1.0 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.45 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.44 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.43 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.42 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.41 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.40 node_modules/cross-spawn/index.js
wice_grid-7.1.0 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.39 node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.38 node_modules/cross-spawn/index.js
optimacms-0.1.61 spec/dummy/node_modules/webpack-cli/node_modules/cross-spawn/index.js
optimacms-0.1.61 spec/dummy/node_modules/execa/node_modules/cross-spawn/index.js
immosquare-cleaner-0.1.32 node_modules/cross-spawn/index.js