cross-spawn-cb 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/constants.js
CHANGED
|
@@ -9,4 +9,4 @@ module.exports = {
|
|
|
9
9
|
'output'
|
|
10
10
|
]
|
|
11
11
|
};
|
|
12
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
12
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/index.js
CHANGED
|
@@ -29,4 +29,4 @@ function _interop_require_default(obj) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
var _default = _spawnCallback.default;
|
|
32
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
32
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/polyfills.js
CHANGED
|
@@ -19,4 +19,4 @@ if (!cp.spawnSync) {
|
|
|
19
19
|
}, spawnCallback, cmd, args, options || {});
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
22
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/dist/cjs/spawn.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
var major = +process.versions.node.split('.')[0];
|
|
3
3
|
var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.js').spawn : require('cross-spawn').spawn;
|
|
4
4
|
module.exports = spawn;
|
|
5
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
5
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
require('./polyfills.js');
|
|
3
|
-
var once = require('once');
|
|
3
|
+
var once = require('call-once-fn');
|
|
4
4
|
var nextTick = require('next-tick');
|
|
5
5
|
var constants = require('./constants');
|
|
6
6
|
var spawn = require('./spawn');
|
|
@@ -80,4 +80,4 @@ function spawnCallback(command, args, options, callback) {
|
|
|
80
80
|
}
|
|
81
81
|
module.exports = spawnCallback;
|
|
82
82
|
module.exports.normalize = normalize;
|
|
83
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
83
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills.cjs');\nconst once = require('once');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(cp, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n // collect output\n const res = { stdout: null, stderr: null };\n if (options.encoding) {\n if (cp.stdout) {\n res.stdout = [];\n cp.stdout.on('data', res.stdout.push.bind(res.stdout));\n }\n if (cp.stderr) {\n res.stderr = [];\n cp.stderr.on('data', res.stderr.push.bind(res.stderr));\n }\n }\n\n // some versions of node emit both an error and close\n cp.on('error', function error(err) {\n err.code === 'OK' || callback(err);\n });\n\n // done\n cp.on('close', (status, signal) => {\n nextTick(function closeNextTick() {\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (res.stdout) {\n res.stdout = Buffer.concat(res.stdout);\n if (options.encoding !== 'buffer') res.stdout = res.stdout.toString(options.encoding);\n }\n if (res.stderr) {\n res.stderr = Buffer.concat(res.stderr);\n if (options.encoding !== 'buffer') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n\n // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n err ? callback(err) : callback(null, res);\n });\n });\n\n // pipe input\n if (options.input && (typeof options.input === 'string' || Buffer.isBuffer(options.input))) {\n cp.stdin.end(options.input);\n }\n}\n\nfunction spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n const cp = spawn(command, args, options);\n return normalize(cp, options, callback);\n}\n\nmodule.exports = spawnCallback;\nmodule.exports.normalize = normalize;\n"],"names":["require","once","nextTick","constants","spawn","normalize","cp","options","callback","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end","spawnCallback","command","args","module","exports"],"mappings":";AAAAA,QAAQ;AACR,IAA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MgC,SAASC,MAAM9B;IAChC,OAAOF,UAAUC,IAAIC,SAASC;AAChC;AAEA8B,OAAOC,OAAO,GAAGJ;AACjBG,OAAOC,OAAO,CAAClC,SAAS,GAAGA"}
|
|
1
|
+
{"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills.cjs');\nconst once = require('call-once-fn');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(cp, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n // collect output\n const res = { stdout: null, stderr: null };\n if (options.encoding) {\n if (cp.stdout) {\n res.stdout = [];\n cp.stdout.on('data', res.stdout.push.bind(res.stdout));\n }\n if (cp.stderr) {\n res.stderr = [];\n cp.stderr.on('data', res.stderr.push.bind(res.stderr));\n }\n }\n\n // some versions of node emit both an error and close\n cp.on('error', function error(err) {\n err.code === 'OK' || callback(err);\n });\n\n // done\n cp.on('close', (status, signal) => {\n nextTick(function closeNextTick() {\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (res.stdout) {\n res.stdout = Buffer.concat(res.stdout);\n if (options.encoding !== 'buffer') res.stdout = res.stdout.toString(options.encoding);\n }\n if (res.stderr) {\n res.stderr = Buffer.concat(res.stderr);\n if (options.encoding !== 'buffer') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n\n // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n err ? callback(err) : callback(null, res);\n });\n });\n\n // pipe input\n if (options.input && (typeof options.input === 'string' || Buffer.isBuffer(options.input))) {\n cp.stdin.end(options.input);\n }\n}\n\nfunction spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n const cp = spawn(command, args, options);\n return normalize(cp, options, callback);\n}\n\nmodule.exports = spawnCallback;\nmodule.exports.normalize = normalize;\n"],"names":["require","once","nextTick","constants","spawn","normalize","cp","options","callback","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end","spawnCallback","command","args","module","exports"],"mappings":";AAAAA,QAAQ;AACR,IAAMC,OAAOD,QAAQ;AACrB,IAAME,WAAWF,QAAQ;AACzB,IAAMG,YAAYH,QAAQ;AAC1B,IAAMI,QAAQJ,QAAQ;AAEtB,SAASK,UAAUC,EAAE,EAAEC,OAAO,EAAEC,QAAQ;IACtC,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWP,KAAKO;IAEhB,iBAAiB;IACjB,IAAMC,MAAM;QAAEC,QAAQ;QAAMC,QAAQ;IAAK;IACzC,IAAIJ,QAAQK,QAAQ,EAAE;QACpB,IAAIN,GAAGI,MAAM,EAAE;YACbD,IAAIC,MAAM,GAAG,EAAE;YACfJ,GAAGI,MAAM,CAACG,EAAE,CAAC,QAAQJ,IAAIC,MAAM,CAACI,IAAI,CAACC,IAAI,CAACN,IAAIC,MAAM;QACtD;QACA,IAAIJ,GAAGK,MAAM,EAAE;YACbF,IAAIE,MAAM,GAAG,EAAE;YACfL,GAAGK,MAAM,CAACE,EAAE,CAAC,QAAQJ,IAAIE,MAAM,CAACG,IAAI,CAACC,IAAI,CAACN,IAAIE,MAAM;QACtD;IACF;IAEA,qDAAqD;IACrDL,GAAGO,EAAE,CAAC,SAAS,SAASG,MAAMC,GAAG;QAC/BA,IAAIC,IAAI,KAAK,QAAQV,SAASS;IAChC;IAEA,OAAO;IACPX,GAAGO,EAAE,CAAC,SAAS,SAACM,QA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KAAK,YAAYT,OAAOQ,QAAQ,CAACxB,QAAQyB,KAAK,CAAA,GAAI;QAC1F1B,GAAG2B,KAAK,CAACC,GAAG,CAAC3B,QAAQyB,KAAK;IAC5B;AACF;AAEA,SAASG,cAAcC,OAAO,EAAEC,IAAI,EAAE9B,OAAO,EAAEC,QAAQ;IACrD,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWP,KAAKO;IAChB,IAAMF,KAAKF,MAAMgC,SAASC,MAAM9B;IAChC,OAAOF,UAAUC,IAAIC,SAASC;AAChC;AAEA8B,OAAOC,OAAO,GAAGJ;AACjBG,OAAOC,OAAO,CAAClC,SAAS,GAAGA"}
|
|
@@ -36,4 +36,4 @@ function spawnCallbackSync(command, args, options) {
|
|
|
36
36
|
}
|
|
37
37
|
module.exports = spawnCallbackSync;
|
|
38
38
|
module.exports.normalize = normalize;
|
|
39
|
-
/* CJS INTEROP */ if (exports.__esModule && exports.default) { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) exports.default[key] = exports[key]; module.exports = exports.default; }
|
|
39
|
+
/* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-spawn-cb",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Cross spawn with a completion callback",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-spawn",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"buffer-v6-polyfill": "^1.0.5",
|
|
31
|
+
"call-once-fn": "^1.0.1",
|
|
31
32
|
"core-js": "^3.39.0",
|
|
32
33
|
"cross-spawn": "^7.0.6",
|
|
33
|
-
"function-exec-sync": "^1.0.
|
|
34
|
+
"function-exec-sync": "^1.0.1",
|
|
34
35
|
"next-tick": "^1.1.0",
|
|
35
|
-
"once": "^1.4.0",
|
|
36
36
|
"semver": "^5.7.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"mocha-compat": "^3.6.1",
|
|
46
46
|
"node-install-release": "^1.4.0",
|
|
47
47
|
"node-resolve-versions": "^1.0.0",
|
|
48
|
-
"node-version-utils": "^1.0.
|
|
49
|
-
"ts-dev-stack": "^0.
|
|
48
|
+
"node-version-utils": "^1.0.1",
|
|
49
|
+
"ts-dev-stack": "^1.0.1"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=0.8"
|