Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

cross-spawn-cb

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross-spawn-cb - npm Package Compare versions

Comparing version
2.5.3
to
3.0.0
+3
-1
dist/cjs/spawn.d.cts
import spawnSync from './spawnSync.js';
import type { SpawnCallback, SpawnOptions, SpawnResult } from './types.js';
declare function spawn(command: string, args: string[], options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): undefined | Promise<SpawnResult>;
declare function spawn(command: string, args: string[], callback: SpawnCallback): void;
declare function spawn(command: string, args: string[], options: SpawnOptions, callback: SpawnCallback): void;
declare function spawn(command: string, args: string[], options?: SpawnOptions): Promise<SpawnResult>;
declare namespace spawn {

@@ -5,0 +7,0 @@ var worker: typeof import("./workers/async.js").default;

import spawnSync from './spawnSync.js';
import type { SpawnCallback, SpawnOptions, SpawnResult } from './types.js';
declare function spawn(command: string, args: string[], options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): undefined | Promise<SpawnResult>;
declare function spawn(command: string, args: string[], callback: SpawnCallback): void;
declare function spawn(command: string, args: string[], options: SpawnOptions, callback: SpawnCallback): void;
declare function spawn(command: string, args: string[], options?: SpawnOptions): Promise<SpawnResult>;
declare namespace spawn {

@@ -5,0 +7,0 @@ var worker: typeof import("./workers/async.js").default;

@@ -8,3 +8,3 @@ "use strict";

get: function() {
return spawn;
return _default;
}

@@ -37,2 +37,3 @@ });

spawn.crossSpawn = _crossSpawnts.default;
var _default = spawn;
/* 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 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/spawn.ts"],"sourcesContent":["import crossSpawn from './crossSpawn.ts';\nimport spawnSync from './spawnSync.ts';\nimport type { SpawnCallback, SpawnOptions, SpawnResult } from './types.ts';\nimport worker from './workers/async.ts';\n\nexport default function spawn(command: string, args: string[], options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): undefined | Promise<SpawnResult> {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n const cp = crossSpawn(command, args, options);\n\n if (typeof callback === 'function') return worker(cp, options, callback) as undefined;\n return new Promise((resolve, reject) => worker(cp, options, (err, res) => (err ? reject(err) : resolve(res))));\n}\nspawn.worker = worker;\nspawn.sync = spawnSync;\nspawn.crossSpawn = crossSpawn;\n"],"names":["spawn","command","args","options","callback","cp","crossSpawn","worker","Promise","resolve","reject","err","res","sync","spawnSync"],"mappings":";;;;+BAKA;;;eAAwBA;;;mEALD;kEACD;8DAEH;;;;;;AAEJ,SAASA,MAAMC,OAAe,EAAEC,IAAc,EAAEC,OAAsC,EAAEC,QAAwB;IAC7H,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtB,IAAME,KAAKC,IAAAA,qBAAU,EAACL,SAASC,MAAMC;IAErC,IAAI,OAAOC,aAAa,YAAY,OAAOG,IAAAA,gBAAM,EAACF,IAAIF,SAASC;IAC/D,OAAO,IAAII,QAAQ,SAACC,SAASC;eAAWH,IAAAA,gBAAM,EAACF,IAAIF,SAAS,SAACQ,KAAKC;mBAASD,MAAMD,OAAOC,OAAOF,QAAQG;;;AACzG;AACAZ,MAAMO,MAAM,GAAGA,gBAAM;AACrBP,MAAMa,IAAI,GAAGC,oBAAS;AACtBd,MAAMM,UAAU,GAAGA,qBAAU"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/spawn.ts"],"sourcesContent":["import crossSpawn from './crossSpawn.ts';\nimport spawnSync from './spawnSync.ts';\nimport type { SpawnCallback, SpawnOptions, SpawnResult } from './types.ts';\nimport worker from './workers/async.ts';\n\nfunction spawn(command: string, args: string[], callback: SpawnCallback): void;\nfunction spawn(command: string, args: string[], options: SpawnOptions, callback: SpawnCallback): void;\nfunction spawn(command: string, args: string[], options?: SpawnOptions): Promise<SpawnResult>;\nfunction spawn(command: string, args: string[], options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): void | Promise<SpawnResult> {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n const cp = crossSpawn(command, args, options);\n\n if (typeof callback === 'function') return worker(cp, options, callback);\n return new Promise((resolve, reject) => worker(cp, options as SpawnOptions, (err, res) => (err ? reject(err) : resolve(res))));\n}\nspawn.worker = worker;\nspawn.sync = spawnSync;\nspawn.crossSpawn = crossSpawn;\n\nexport default spawn;\n"],"names":["spawn","command","args","options","callback","cp","crossSpawn","worker","Promise","resolve","reject","err","res","sync","spawnSync"],"mappings":";;;;+BAuBA;;;eAAA;;;mEAvBuB;kEACD;8DAEH;;;;;;AAKnB,SAASA,MAAMC,OAAe,EAAEC,IAAc,EAAEC,OAAsC,EAAEC,QAAwB;IAC9G,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtB,IAAME,KAAKC,IAAAA,qBAAU,EAACL,SAASC,MAAMC;IAErC,IAAI,OAAOC,aAAa,YAAY,OAAOG,IAAAA,gBAAM,EAACF,IAAIF,SAASC;IAC/D,OAAO,IAAII,QAAQ,SAACC,SAASC;eAAWH,IAAAA,gBAAM,EAACF,IAAIF,SAAyB,SAACQ,KAAKC;mBAASD,MAAMD,OAAOC,OAAOF,QAAQG;;;AACzH;AACAZ,MAAMO,MAAM,GAAGA,gBAAM;AACrBP,MAAMa,IAAI,GAAGC,oBAAS;AACtBd,MAAMM,UAAU,GAAGA,qBAAU;IAE7B,WAAeN"}

@@ -35,3 +35,3 @@ import type * as child_process from 'child_process';

export interface Enoent {
hookChildProcess: (cp: ChildProcess, parsed: Parsed) => undefined;
hookChildProcess: (cp: ChildProcess, parsed: Parsed) => void;
verifyENOENT: (status: number, parsed: Parsed) => NotFoundError | null;

@@ -38,0 +38,0 @@ verifyENOENTSync: (status: number, parsed: Parsed) => NotFoundError | null;

@@ -35,3 +35,3 @@ import type * as child_process from 'child_process';

export interface Enoent {
hookChildProcess: (cp: ChildProcess, parsed: Parsed) => undefined;
hookChildProcess: (cp: ChildProcess, parsed: Parsed) => void;
verifyENOENT: (status: number, parsed: Parsed) => NotFoundError | null;

@@ -38,0 +38,0 @@ verifyENOENTSync: (status: number, parsed: Parsed) => NotFoundError | null;

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/workers/async.ts"],"sourcesContent":["import oo from 'on-one';\nimport { spawnKeys } from '../constants.ts';\n\nimport type { ChildProcess, SpawnCallback, SpawnError, SpawnOptions, SpawnResult } from '../types.ts';\n\nexport default function worker(cp: ChildProcess, options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n // collect output\n const res = { pid: 0, output: [], stdout: null, stderr: null, status: null, signal: null } as SpawnResult;\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n if (options.encoding && cp.stdout) cp.stdout.on('data', stdout.push.bind(stdout));\n if (options.encoding && cp.stderr) cp.stderr.on('data', stderr.push.bind(stderr));\n\n // some versions of node emit both an error and close\n oo(cp, ['error', 'close'], (err: Error | null, status: number | null, signal: NodeJS.Signals | null) => {\n if (err) {\n if ((err as SpawnError).code === 'OK') return; // ignore\n return callback(err as SpawnError);\n }\n\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (options.encoding && cp.stdout) {\n res.stdout = Buffer.concat(stdout);\n if (options.encoding !== 'binary') res.stdout = res.stdout.toString(options.encoding);\n }\n if (options.encoding && cp.stderr) {\n res.stderr = Buffer.concat(stderr);\n if (options.encoding !== 'binary') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n if (res.status === null) res.status = 0; // patch: early node on windows could return null\n\n // process errors\n const exitErr = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (exitErr) {\n for (const key in res) {\n if (spawnKeys.indexOf(key) < 0) continue;\n exitErr[key] = Buffer.isBuffer(res[key]) ? res[key].toString(options.encoding || 'utf8') : res[key];\n }\n }\n exitErr ? callback(exitErr as SpawnError) : callback(null, res);\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":["worker","cp","options","callback","res","pid","output","stdout","stderr","status","signal","encoding","on","push","bind","oo","err","code","Buffer","concat","toString","exitErr","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end"],"mappings":";;;;+BAKA;;;eAAwBA;;;4DALT;2BACW;;;;;;AAIX,SAASA,OAAOC,EAAgB,EAAEC,OAAsC,EAAEC,QAAwB;IAC/G,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtB,iBAAiB;IACjB,IAAME,MAAM;QAAEC,KAAK;QAAGC,QAAQ,EAAE;QAAEC,QAAQ;QAAMC,QAAQ;QAAMC,QAAQ;QAAMC,QAAQ;IAAK;IACzF,IAAMH,SAAmB,EAAE;IAC3B,IAAMC,SAAmB,EAAE;IAC3B,IAAIN,QAAQS,QAAQ,IAAIV,GAAGM,MAAM,EAAEN,GAAGM,MAAM,CAACK,EAAE,CAAC,QAAQL,OAAOM,IAAI,CAACC,IAAI,CAACP;IACzE,IAAIL,QAAQS,QAAQ,IAAIV,GAAGO,MAAM,EAAEP,GAAGO,MAAM,CAACI,EAAE,CAAC,QAAQJ,OAAOK,IAAI,CAACC,IAAI,CAACN;IAEzE,qDAAqD;IACrDO,IAAAA,cAAE,EAACd,I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mB,IAAI;YACrG;QACF;QACAF,UAAUlB,SAASkB,WAAyBlB,SAAS,MAAMC;IAC7D;IAEA,aAAa;IACb,IAAIF,QAAQyB,KAAK,IAAK,CAAA,OAAOzB,QAAQyB,KAAK,KAAK,YAAYT,OAAOQ,QAAQ,CAACxB,QAAQyB,KAAK,CAAA,GAAI;QAC1F1B,GAAG2B,KAAK,CAACC,GAAG,CAAC3B,QAAQyB,KAAK;IAC5B;AACF"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/workers/async.ts"],"sourcesContent":["import oo from 'on-one';\nimport { spawnKeys } from '../constants.ts';\n\nimport type { ChildProcess, SpawnCallback, SpawnError, SpawnOptions, SpawnResult } from '../types.ts';\n\nexport default function worker(cp: ChildProcess, options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n // collect output\n const res = { pid: 0, output: [], stdout: null, stderr: null, status: null, signal: null } as SpawnResult;\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n if (options.encoding && cp.stdout) cp.stdout.on('data', stdout.push.bind(stdout));\n if (options.encoding && cp.stderr) cp.stderr.on('data', stderr.push.bind(stderr));\n\n // some versions of node emit both an error and close\n oo(cp, ['error', 'close'], (err: Error | null, status: number | null, signal: NodeJS.Signals | null) => {\n if (err) {\n if ((err as SpawnError).code === 'OK') return; // ignore\n return callback(err as SpawnError);\n }\n\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (options.encoding && cp.stdout) {\n res.stdout = Buffer.concat(stdout);\n if (options.encoding !== 'binary') res.stdout = res.stdout.toString(options.encoding);\n }\n if (options.encoding && cp.stderr) {\n res.stderr = Buffer.concat(stderr);\n if (options.encoding !== 'binary') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n if (res.status === null) res.status = 0; // patch: early node on windows could return null\n\n // process errors\n const exitErr = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (exitErr) {\n for (const key in res) {\n if (spawnKeys.indexOf(key) < 0) continue;\n exitErr[key] = Buffer.isBuffer(res[key]) ? res[key].toString(options.encoding || 'utf8') : res[key];\n }\n }\n exitErr ? callback(exitErr as SpawnError) : callback(null, res);\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":["worker","cp","options","callback","res","pid","output","stdout","stderr","status","signal","encoding","on","push","bind","oo","err","code","Buffer","concat","toString","exitErr","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end"],"mappings":";;;;+BAKA;;;eAAwBA;;;4DALT;2BACW;;;;;;AAIX,SAASA,OAAOC,EAAgB,EAAEC,OAAsC,EAAEC,QAAwB;IAC/G,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtB,iBAAiB;IACjB,IAAME,MAAM;QAAEC,KAAK;QAAGC,QAAQ,EAAE;QAAEC,QAAQ;QAAMC,QAAQ;QAAMC,QAAQ;QAAMC,QAAQ;IAAK;IACzF,IAAMH,SAAmB,EAAE;IAC3B,IAAMC,SAAmB,EAAE;IAC3B,IAAIN,QAAQS,QAAQ,IAAIV,GAAGM,MAAM,EAAEN,GAAGM,MAAM,CAACK,EAAE,CAAC,QAAQL,OAAOM,IAAI,CAACC,IAAI,CAACP;IACzE,IAAIL,QAAQS,QAAQ,IAAIV,GAAGO,MAAM,EAAEP,GAAGO,MAAM,CAACI,EAAE,CAAC,QAAQJ,OAAOK,IAAI,CAACC,IAAI,CAACN;IAEzE,qDAAqD;IACrDO,IAAAA,cAAE,EAACd,IAAI;QAAC;QAAS;KAAQ,EAAE,SAACe,KAAmBP,QAAuBC;QACpE,IAAIM,KAAK;YACP,IAAI,AAACA,IAAmBC,IAAI,KAAK,MAAM,QAAQ,SAAS;YACxD,OAAOd,SAASa;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AK,YAAYT,OAAOQ,QAAQ,CAACxB,QAAQyB,KAAK,CAAA,GAAI;QAC1F1B,GAAG2B,KAAK,CAACC,GAAG,CAAC3B,QAAQyB,KAAK;IAC5B;AACF"}
import spawnSync from './spawnSync.js';
import type { SpawnCallback, SpawnOptions, SpawnResult } from './types.js';
declare function spawn(command: string, args: string[], options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): undefined | Promise<SpawnResult>;
declare function spawn(command: string, args: string[], callback: SpawnCallback): void;
declare function spawn(command: string, args: string[], options: SpawnOptions, callback: SpawnCallback): void;
declare function spawn(command: string, args: string[], options?: SpawnOptions): Promise<SpawnResult>;
declare namespace spawn {

@@ -5,0 +7,0 @@ var worker: typeof import("./workers/async.js").default;

import crossSpawn from './crossSpawn.js';
import spawnSync from './spawnSync.js';
import worker from './workers/async.js';
export default function spawn(command, args, options, callback) {
function spawn(command, args, options, callback) {
if (typeof options === 'function') {

@@ -17,1 +17,2 @@ callback = options;

spawn.crossSpawn = crossSpawn;
export default spawn;

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/spawn.ts"],"sourcesContent":["import crossSpawn from './crossSpawn.ts';\nimport spawnSync from './spawnSync.ts';\nimport type { SpawnCallback, SpawnOptions, SpawnResult } from './types.ts';\nimport worker from './workers/async.ts';\n\nexport default function spawn(command: string, args: string[], options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): undefined | Promise<SpawnResult> {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n const cp = crossSpawn(command, args, options);\n\n if (typeof callback === 'function') return worker(cp, options, callback) as undefined;\n return new Promise((resolve, reject) => worker(cp, options, (err, res) => (err ? reject(err) : resolve(res))));\n}\nspawn.worker = worker;\nspawn.sync = spawnSync;\nspawn.crossSpawn = crossSpawn;\n"],"names":["crossSpawn","spawnSync","worker","spawn","command","args","options","callback","cp","Promise","resolve","reject","err","res","sync"],"mappings":"AAAA,OAAOA,gBAAgB,kBAAkB;AACzC,OAAOC,eAAe,iBAAiB;AAEvC,OAAOC,YAAY,qBAAqB;AAExC,eAAe,SAASC,MAAMC,OAAe,EAAEC,IAAc,EAAEC,OAAsC,EAAEC,QAAwB;IAC7H,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtB,MAAME,KAAKR,WAAWI,SAASC,MAAMC;IAErC,IAAI,OAAOC,aAAa,YAAY,OAAOL,OAAOM,IAAIF,SAASC;IAC/D,OAAO,IAAIE,QAAQ,CAACC,SAASC,SAAWT,OAAOM,IAAIF,SAAS,CAACM,KAAKC,MAASD,MAAMD,OAAOC,OAAOF,QAAQG;AACzG;AACAV,MAAMD,MAAM,GAAGA;AACfC,MAAMW,IAAI,GAAGb;AACbE,MAAMH,UAAU,GAAGA"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/spawn.ts"],"sourcesContent":["import crossSpawn from './crossSpawn.ts';\nimport spawnSync from './spawnSync.ts';\nimport type { SpawnCallback, SpawnOptions, SpawnResult } from './types.ts';\nimport worker from './workers/async.ts';\n\nfunction spawn(command: string, args: string[], callback: SpawnCallback): void;\nfunction spawn(command: string, args: string[], options: SpawnOptions, callback: SpawnCallback): void;\nfunction spawn(command: string, args: string[], options?: SpawnOptions): Promise<SpawnResult>;\nfunction spawn(command: string, args: string[], options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): void | Promise<SpawnResult> {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n const cp = crossSpawn(command, args, options);\n\n if (typeof callback === 'function') return worker(cp, options, callback);\n return new Promise((resolve, reject) => worker(cp, options as SpawnOptions, (err, res) => (err ? reject(err) : resolve(res))));\n}\nspawn.worker = worker;\nspawn.sync = spawnSync;\nspawn.crossSpawn = crossSpawn;\n\nexport default spawn;\n"],"names":["crossSpawn","spawnSync","worker","spawn","command","args","options","callback","cp","Promise","resolve","reject","err","res","sync"],"mappings":"AAAA,OAAOA,gBAAgB,kBAAkB;AACzC,OAAOC,eAAe,iBAAiB;AAEvC,OAAOC,YAAY,qBAAqB;AAKxC,SAASC,MAAMC,OAAe,EAAEC,IAAc,EAAEC,OAAsC,EAAEC,QAAwB;IAC9G,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtB,MAAME,KAAKR,WAAWI,SAASC,MAAMC;IAErC,IAAI,OAAOC,aAAa,YAAY,OAAOL,OAAOM,IAAIF,SAASC;IAC/D,OAAO,IAAIE,QAAQ,CAACC,SAASC,SAAWT,OAAOM,IAAIF,SAAyB,CAACM,KAAKC,MAASD,MAAMD,OAAOC,OAAOF,QAAQG;AACzH;AACAV,MAAMD,MAAM,GAAGA;AACfC,MAAMW,IAAI,GAAGb;AACbE,MAAMH,UAAU,GAAGA;AAEnB,eAAeG,MAAM"}

@@ -35,3 +35,3 @@ import type * as child_process from 'child_process';

export interface Enoent {
hookChildProcess: (cp: ChildProcess, parsed: Parsed) => undefined;
hookChildProcess: (cp: ChildProcess, parsed: Parsed) => void;
verifyENOENT: (status: number, parsed: Parsed) => NotFoundError | null;

@@ -38,0 +38,0 @@ verifyENOENTSync: (status: number, parsed: Parsed) => NotFoundError | null;

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/types.ts"],"sourcesContent":["import type * as child_process from 'child_process';\n\nexport type ChildProcess = child_process.ChildProcess;\nexport interface SpawnOptions extends child_process.SpawnOptions {\n encoding?: BufferEncoding;\n env?: NodeJS.ProcessEnv;\n input?: string | Buffer;\n}\nexport interface SpawnSyncOptions extends child_process.SpawnSyncOptions {\n encoding?: BufferEncoding;\n env?: NodeJS.ProcessEnv;\n input?: string | Buffer;\n}\nexport type SpawnResult = child_process.SpawnSyncReturns<string | Buffer>;\n\nexport interface Parsed {\n command: string;\n args: string[];\n options: SpawnOptions | SpawnSyncOptions;\n file?: string | null;\n original?: {\n command: string;\n args: string[];\n };\n}\n\nexport interface NotFoundError extends Error {\n code?: string;\n errno?: string;\n syscall?: string;\n path?: string;\n spawnargs?: string[];\n}\nexport interface SpawnError extends NotFoundError, SpawnResult {}\n\nexport type SpawnCallback = (err?: SpawnError, res?: SpawnResult) => void;\n\nexport interface Enoent {\n hookChildProcess: (cp: ChildProcess, parsed: Parsed) => undefined;\n verifyENOENT: (status: number, parsed: Parsed) => NotFoundError | null;\n verifyENOENTSync: (status: number, parsed: Parsed) => NotFoundError | null;\n notFoundError: (cp: ChildProcess, parsed: Parsed) => NotFoundError;\n}\n"],"names":[],"mappings":"AAqCA,WAKC"}
{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/types.ts"],"sourcesContent":["import type * as child_process from 'child_process';\n\nexport type ChildProcess = child_process.ChildProcess;\nexport interface SpawnOptions extends child_process.SpawnOptions {\n encoding?: BufferEncoding;\n env?: NodeJS.ProcessEnv;\n input?: string | Buffer;\n}\nexport interface SpawnSyncOptions extends child_process.SpawnSyncOptions {\n encoding?: BufferEncoding;\n env?: NodeJS.ProcessEnv;\n input?: string | Buffer;\n}\nexport type SpawnResult = child_process.SpawnSyncReturns<string | Buffer>;\n\nexport interface Parsed {\n command: string;\n args: string[];\n options: SpawnOptions | SpawnSyncOptions;\n file?: string | null;\n original?: {\n command: string;\n args: string[];\n };\n}\n\nexport interface NotFoundError extends Error {\n code?: string;\n errno?: string;\n syscall?: string;\n path?: string;\n spawnargs?: string[];\n}\nexport interface SpawnError extends NotFoundError, SpawnResult {}\n\nexport type SpawnCallback = (err?: SpawnError, res?: SpawnResult) => void;\n\nexport interface Enoent {\n hookChildProcess: (cp: ChildProcess, parsed: Parsed) => void;\n verifyENOENT: (status: number, parsed: Parsed) => NotFoundError | null;\n verifyENOENTSync: (status: number, parsed: Parsed) => NotFoundError | null;\n notFoundError: (cp: ChildProcess, parsed: Parsed) => NotFoundError;\n}\n"],"names":[],"mappings":"AAqCA,WAKC"}

@@ -1,1 +0,1 @@

{"version":3,"sources":["/Users/kevin/Dev/OpenSource/compat/cross-spawn-cb/src/workers/async.ts"],"sourcesContent":["import oo from 'on-one';\nimport { spawnKeys } from '../constants.ts';\n\nimport type { ChildProcess, SpawnCallback, SpawnError, SpawnOptions, SpawnResult } from '../types.ts';\n\nexport default function worker(cp: ChildProcess, options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n // collect output\n const res = { pid: 0, output: [], stdout: null, stderr: null, status: null, signal: null } as SpawnResult;\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n if (options.encoding && cp.stdout) cp.stdout.on('data', stdout.push.bind(stdout));\n if (options.encoding && cp.stderr) cp.stderr.on('data', stderr.push.bind(stderr));\n\n // some versions of node emit both an error and close\n oo(cp, ['error', 'close'], (err: Error | null, status: number | null, signal: NodeJS.Signals | null) => {\n if (err) {\n if ((err as SpawnError).code === 'OK') return; // ignore\n return callback(err as SpawnError);\n }\n\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (options.encoding && cp.stdout) {\n res.stdout = Buffer.concat(stdout);\n if (options.encoding !== 'binary') res.stdout = res.stdout.toString(options.encoding);\n }\n if (options.encoding && cp.stderr) {\n res.stderr = Buffer.concat(stderr);\n if (options.encoding !== 'binary') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n if (res.status === null) res.status = 0; // patch: early node on windows could return null\n\n // process errors\n const exitErr = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (exitErr) {\n for (const key in res) {\n if (spawnKeys.indexOf(key) < 0) continue;\n exitErr[key] = Buffer.isBuffer(res[key]) ? res[key].toString(options.encoding || 'utf8') : res[key];\n }\n }\n exitErr ? callback(exitErr as SpawnError) : callback(null, res);\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":["oo","spawnKeys","worker","cp","options","callback","res","pid","output","stdout","stderr","status","signal","encoding","on","push","bind","err","code","Buffer","concat","toString","exitErr","Error","key","indexOf","isBuffer","input","stdin","end"],"mappings":"AAAA,OAAOA,QAAQ,SAAS;AACxB,SAASC,SAAS,QAAQ,kBAAkB;AAI5C,eAAe,SAASC,OAAOC,EAAgB,EAAEC,OAAsC,EAAEC,QAAwB;IAC/G,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IAEtB,iBAAiB;IACjB,MAAME,MAAM;QAAEC,KAAK;QAAGC,QAAQ,EAAE;QAAEC,QAAQ;QAAMC,QAAQ;QAAMC,QAAQ;QAAMC,QAAQ;IAAK;IACzF,MAAMH,SAAmB,EAAE;IAC3B,MAAMC,SAAmB,EAAE;IAC3B,IAAIN,QAAQS,QAAQ,IAAIV,GAAGM,MAAM,EAAEN,GAAGM,MAAM,CAACK,EAAE,CAAC,QAAQL,OAAOM,IAAI,CAACC,IAAI,CAACP;IACzE,IAAIL,QAAQS,QAAQ,IAAIV,GAAGO,MAAM,EAAEP,GAAGO,MAAM,CAACI,EAAE,CAAC,QAAQJ,OAAOK,IAAI,CAACC,IAAI,CAACN;IAEzE,qDAAqD;IACrDV,GAAGG,IAAI;QAAC;QAAS;KAAQ,EAAE,CAACc,KAAmBN,QAAuBC;QACpE,IAAIK,KAAK;YACP,IAAI,AAACA,IAAmBC,IAAI,KAAK,MAAM,QAAQ,SAAS;YACxD,OAAOb,SAASY;QAClB;QAEA,iBAAiB;QACjBX,IAAIC,GAAG,GAAGJ,GAAGI,GAAG;QAChBD,IAAIK,MAAM,GAAGA;QACbL,IAAIM,MAAM,GAAGA;QACb,IAAIR,QAAQS,QAAQ,IAAIV,GAAGM,MAAM,EAAE;YACjCH,IAAIG,MAAM,GAAGU,OAAOC,M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o from 'on-one';\nimport { spawnKeys } from '../constants.ts';\n\nimport type { ChildProcess, SpawnCallback, SpawnError, SpawnOptions, SpawnResult } from '../types.ts';\n\nexport default function worker(cp: ChildProcess, options?: SpawnOptions | SpawnCallback, callback?: SpawnCallback): void {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n\n // collect output\n const res = { pid: 0, output: [], stdout: null, stderr: null, status: null, signal: null } as SpawnResult;\n const stdout: Buffer[] = [];\n const stderr: Buffer[] = [];\n if (options.encoding && cp.stdout) cp.stdout.on('data', stdout.push.bind(stdout));\n if (options.encoding && cp.stderr) cp.stderr.on('data', stderr.push.bind(stderr));\n\n // some versions of node emit both an error and close\n oo(cp, ['error', 'close'], (err: Error | null, status: number | null, signal: NodeJS.Signals | null) => {\n if (err) {\n if ((err as SpawnError).code === 'OK') return; // ignore\n return callback(err as SpawnError);\n }\n\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (options.encoding && cp.stdout) {\n res.stdout = Buffer.concat(stdout);\n if (options.encoding !== 'binary') res.stdout = res.stdout.toString(options.encoding);\n }\n if (options.encoding && cp.stderr) {\n res.stderr = Buffer.concat(stderr);\n if (options.encoding !== 'binary') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n if (res.status === null) res.status = 0; // patch: early node on windows could return null\n\n // process errors\n const exitErr = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (exitErr) {\n for (const key in res) {\n if (spawnKeys.indexOf(key) < 0) continue;\n exitErr[key] = Buffer.isBuffer(res[key]) ? res[key].toString(options.encoding || 'utf8') : res[key];\n }\n }\n exitErr ? callback(exitErr as SpawnError) : callback(null, res);\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":["oo","spawnKeys","worker","cp","options","callback","res","pid","output","stdout","stderr","status","signal","encoding","on","push","bind","err","code","Buffer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QAAQS,QAAQ,IAAIV,GAAGO,MAAM,EAAE;YACjCJ,IAAII,MAAM,GAAGS,OAAOC,MAAM,CAACV;YAC3B,IAAIN,QAAQS,QAAQ,KAAK,UAAUP,IAAII,MAAM,GAAGJ,IAAII,MAAM,CAACW,QAAQ,CAACjB,QAAQS,QAAQ;QACtF;QACAP,IAAIE,MAAM,GAAG;YAAC;YAAMF,IAAIG,MAAM;YAAEH,IAAII,MAAM;SAAC;QAC3C,IAAIJ,IAAIK,MAAM,KAAK,MAAML,IAAIK,MAAM,GAAG,GAAG,iDAAiD;QAE1F,iBAAiB;QACjB,MAAMW,UAAUhB,IAAIK,MAAM,KAAK,IAAI,IAAIY,MAAM,CAAC,oBAAoB,EAAEjB,IAAIK,MAAM,EAAE,IAAI;QACpF,IAAIW,SAAS;YACX,IAAK,MAAME,OAAOlB,IAAK;gBACrB,IAAIL,UAAUwB,OAAO,CAACD,OAAO,GAAG;gBAChCF,OAAO,CAACE,IAAI,GAAGL,OAAOO,QAAQ,CAACpB,GAAG,CAACkB,IAAI,IAAIlB,GAAG,CAACkB,IAAI,CAACH,QAAQ,CAACjB,QAAQS,QAAQ,IAAI,UAAUP,GAAG,CAACkB,IAAI;YACrG;QACF;QACAF,UAAUjB,SAASiB,WAAyBjB,SAAS,MAAMC;IAC7D;IAEA,aAAa;IACb,IAAIF,QAAQuB,KAAK,IAAK,CAAA,OAAOvB,QAAQuB,KAAK,KAAK,YAAYR,OAAOO,QAAQ,CAACtB,QAAQuB,KAAK,CAAA,GAAI;QAC1FxB,GAAGyB,KAAK,CAACC,GAAG,CAACzB,QAAQuB,KAAK;IAC5B;AACF"}
{
"name": "cross-spawn-cb",
"version": "2.5.3",
"version": "3.0.0",
"description": "Cross spawn with a completion callback",

@@ -55,3 +55,3 @@ "keywords": [

"ts-dev-stack": "*",
"tsds-config": "*"
"tsds-config": "^1.0.4"
},

@@ -58,0 +58,0 @@ "engines": {