cross-spawn-cb 0.6.16 → 0.6.17
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/cross-spawn-6.0.5.js +570 -0
- package/dist/cjs/cross-spawn-6.0.5.js.map +1 -0
- package/dist/cjs/spawnCallback.js +1 -1
- package/dist/cjs/spawnCallback.js.map +1 -1
- package/dist/cjs/spawnSyncCallback.js +1 -1
- package/dist/cjs/spawnSyncCallback.js.map +1 -1
- package/dist/types/cross-spawn-6.0.5.d.ts +36 -0
- package/package.json +2 -3
- package/assets/cross-spawn-6.0.5.js +0 -677
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills');\nconst once = require('once');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\n\nconst major = +process.versions.node.split('.')[0];\nconst spawn = major <= 7 ? require('
|
|
1
|
+
{"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills');\nconst once = require('once');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\n\nconst major = +process.versions.node.split('.')[0];\nconst spawn = major <= 7 ? require('./cross-spawn-6.0.5.js').spawn : require('cross-spawn').spawn;\n\nmodule.exports = function spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n const cp = spawn(command, args, options);\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) console.log('spawnCallback null status code', res);\n // res.status = res.status === null ? 0 : res.status;\n\n // process errors\n let err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (res.stderr && res.stderr.length) {\n err = err || new Error('stderr has content');\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"],"names":["require","once","nextTick","constants","major","process","versions","node","split","spawn","module","exports","spawnCallback","command","args","options","callback","cp","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","console","log","Error","length","key","spawnKeys","indexOf","isBuffer","input","stdin","end"],"mappings":";AAAAA,QAAQ;AACR,IAAMC,OAAOD,QAAQ;AACrB,IAAME,WAAWF,QAAQ;AACzB,IAAMG,YAAYH,QAAQ;AAE1B,IAAMI,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,QAAQL,SAAS,IAAIJ,QAAQ,0BAA0BS,KAAK,GAAGT,QAAQ,eAAeS,KAAK;AAEjGC,OAAOC,OAAO,GAAG,SAASC,cAAcC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,QAAQ;IACtE,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWf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AIiB,MAAM,GAAG;gBAAC;gBAAMjB,IAAIC,MAAM;gBAAED,IAAIE,MAAM;aAAC;YAE3C,iDAAiD;YACjD,IAAIF,IAAIU,MAAM,KAAK,MAAMQ,QAAQC,GAAG,CAAC,kCAAkCnB;YACvE,qDAAqD;YAErD,iBAAiB;YACjB,IAAIQ,MAAMR,IAAIU,MAAM,KAAK,IAAI,IAAIU,MAAM,AAAC,uBAAiC,OAAXpB,IAAIU,MAAM,KAAM;YAC9E,IAAIV,IAAIE,MAAM,IAAIF,IAAIE,MAAM,CAACmB,MAAM,EAAE;gBACnCb,MAAMA,OAAO,IAAIY,MAAM;gBACvB,IAAK,IAAME,OAAOtB,IAAK;oBACrB,IAAIf,UAAUsC,SAAS,CAACC,OAAO,CAACF,OAAO,GAAG;oBAC1Cd,GAAG,CAACc,IAAI,GAAGR,OAAOW,QAAQ,CAACzB,GAAG,CAACsB,IAAI,IAAItB,GAAG,CAACsB,IAAI,CAACN,QAAQ,CAAC,UAAUhB,GAAG,CAACsB,IAAI;gBAC7E;YACF;YACAd,MAAMV,SAASU,OAAOV,SAAS,MAAME;QACvC;IACF;IAEA,aAAa;IACb,IAAIH,QAAQ6B,KAAK,IAAK,CAAA,OAAO7B,QAAQ6B,KAAK,KAAK,YAAYZ,OAAOW,QAAQ,CAAC5B,QAAQ6B,KAAK,CAAA,GAAI;QAC1F3B,GAAG4B,KAAK,CAACC,GAAG,CAAC/B,QAAQ6B,KAAK;IAC5B;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var constants = require("./constants");
|
|
3
3
|
var major = +process.versions.node.split(".")[0];
|
|
4
|
-
var spawnSync = major <= 7 ? require("
|
|
4
|
+
var spawnSync = major <= 7 ? require("./cross-spawn-6.0.5.js").sync : require("cross-spawn").sync;
|
|
5
5
|
module.exports = function spawnSyncCallback(command, args, options) {
|
|
6
6
|
options = options || {};
|
|
7
7
|
var syncOptions = Object.assign({}, options || {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["spawnSyncCallback.js"],"sourcesContent":["const constants = require('./constants');\n\nconst major = +process.versions.node.split('.')[0];\nconst spawnSync = major <= 7 ? require('
|
|
1
|
+
{"version":3,"sources":["spawnSyncCallback.js"],"sourcesContent":["const constants = require('./constants');\n\nconst major = +process.versions.node.split('.')[0];\nconst spawnSync = major <= 7 ? require('./cross-spawn-6.0.5.js').sync : require('cross-spawn').sync;\n\nmodule.exports = function spawnSyncCallback(command, args, options) {\n options = options || {};\n const syncOptions = Object.assign({}, options || {}, {\n env: options.env || process.env,\n stdio: 'pipe',\n encoding: 'utf8',\n });\n\n const res = spawnSync(command, args, syncOptions);\n\n // patch: early node on windows could return null\n if (res.status === null) console.log('spawnSyncCallback null status code', res);\n // res.status = res.status === null ? 0 : res.status;\n\n // pipe if inherited\n if (res.stdout && (options.stdout === 'inherit' || options.stdio === 'inherit')) {\n process.stdout.write(res.stdout);\n res.stdout = null;\n }\n if (res.stderr && (options.stderr === 'inherit' || options.stdio === 'inherit')) {\n process.stderr.write(res.stderr);\n res.stderr = null;\n }\n\n // process errors\n let err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (res.stderr && res.stderr.length) {\n err = err || new Error('stderr has content');\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 if (err) throw err;\n return res;\n};\n"],"names":["constants","require","major","process","versions","node","split","spawnSync","sync","module","exports","spawnSyncCallback","command","args","options","syncOptions","Object","assign","env","stdio","encoding","res","status","console","log","stdout","write","stderr","err","Error","length","key","spawnKeys","indexOf","Buffer","isBuffer","toString"],"mappings":";AAAA,IAAMA,YAAYC,QAAQ;AAE1B,IAAMC,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,YAAYL,SAAS,IAAID,QAAQ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AAQ,CAAC,UAAUf,GAAG,CAACU,IAAI;QAC7E;IACF;IACA,IAAIH,KAAK,MAAMA;IACf,OAAOP;AACT"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const __esModule: boolean;
|
|
2
|
+
export default crossSpawn.exports;
|
|
3
|
+
export namespace _enoent {
|
|
4
|
+
export { hookChildProcess };
|
|
5
|
+
export { verifyENOENT };
|
|
6
|
+
export { verifyENOENTSync };
|
|
7
|
+
export { notFoundError };
|
|
8
|
+
}
|
|
9
|
+
export function _parse(command: any, args: any, options: any): any;
|
|
10
|
+
declare function exports(command: any, args: any, options: any): any;
|
|
11
|
+
declare namespace crossSpawn { }
|
|
12
|
+
declare function spawn_1(command: any, args: any, options: any): any;
|
|
13
|
+
export function sync(command: any, args: any, options: any): any;
|
|
14
|
+
declare function hookChildProcess(cp: any, parsed: any): void;
|
|
15
|
+
declare function verifyENOENT(status: any, parsed: any): Error & {
|
|
16
|
+
code: string;
|
|
17
|
+
errno: string;
|
|
18
|
+
syscall: string;
|
|
19
|
+
path: any;
|
|
20
|
+
spawnargs: any;
|
|
21
|
+
};
|
|
22
|
+
declare function verifyENOENTSync(status: any, parsed: any): Error & {
|
|
23
|
+
code: string;
|
|
24
|
+
errno: string;
|
|
25
|
+
syscall: string;
|
|
26
|
+
path: any;
|
|
27
|
+
spawnargs: any;
|
|
28
|
+
};
|
|
29
|
+
declare function notFoundError(original: any, syscall: any): Error & {
|
|
30
|
+
code: string;
|
|
31
|
+
errno: string;
|
|
32
|
+
syscall: string;
|
|
33
|
+
path: any;
|
|
34
|
+
spawnargs: any;
|
|
35
|
+
};
|
|
36
|
+
export { spawn_1 as spawn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cross-spawn-cb",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.17",
|
|
4
4
|
"description": "Cross spawn with a completion callback",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-spawn",
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
"main": "dist/cjs/index.js",
|
|
16
16
|
"types": "dist/types/index.d.ts",
|
|
17
17
|
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
"assets"
|
|
18
|
+
"dist"
|
|
20
19
|
],
|
|
21
20
|
"scripts": {
|
|
22
21
|
"build": "tsds build",
|