Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

tinyexec

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinyexec - npm Package Compare versions

Comparing version
1.2.3
to
1.2.4
+0
-1
dist/main.d.mts

@@ -90,3 +90,2 @@ import { ChildProcess, SpawnOptions, SpawnSyncOptions } from "node:child_process";

protected _onError: (err: Error) => void;
protected _onExit: () => void;
protected _onClose: () => void;

@@ -93,0 +92,0 @@ }

+19
-36

@@ -185,10 +185,9 @@ import { spawn as e, spawnSync as t } from "node:child_process";

const A = /\r?\n/;
const j = /* @__PURE__ */ new WeakSet();
const M = {
const j = {
timeout: void 0,
persist: false
};
const N = { timeout: void 0 };
const P = { windowsHide: true };
function F(e) {
const M = { timeout: void 0 };
const N = { windowsHide: true };
function P(e) {
const t = new AbortController();

@@ -207,3 +206,3 @@ for (const n of e) {

}
async function I(e) {
async function F(e) {
let t = "";

@@ -215,3 +214,3 @@ try {

}
var L = class {
var I = class {
_process;

@@ -236,3 +235,3 @@ _aborted = false;

this._options = {
...M,
...j,
...n

@@ -256,3 +255,3 @@ };

pipe(e, t, n) {
return B(e, t, {
return z(e, t, {
...n,

@@ -279,3 +278,3 @@ stdin: this

if (!e) throw new Error("No process was started");
const [t, n] = await Promise.all([this._streamOut ? I(this._streamOut) : "", this._streamErr ? I(this._streamErr) : ""]);
const [t, n] = await Promise.all([this._streamOut ? F(this._streamOut) : "", this._streamErr ? F(this._streamErr) : ""]);
await this._processClosed;

@@ -303,3 +302,3 @@ const { stdin: r } = this._options;

const i = {
...P,
...N,
...r.nodeOptions

@@ -312,3 +311,3 @@ };

if (r.persist === true) i.detached = true;
if (a.length > 0) i.signal = F(a);
if (a.length > 0) i.signal = P(a);
i.env = y(t, i.env, r.nodePath);

@@ -321,3 +320,2 @@ const o = D(this._command, this._args, i);

s.once("error", this._onError);
s.once("exit", this._onExit);
s.once("close", this._onClose);

@@ -327,9 +325,3 @@ if (s.stdin) {

if (typeof e === "string") s.stdin.end(e);
else {
const t = e?.process?.stdout;
if (t) {
t.pipe(s.stdin);
j.add(t);
}
}
else e?.process?.stdout?.pipe(s.stdin);
}

@@ -351,11 +343,2 @@ }

};
_onExit = () => {
const e = this._streamOut && !j.has(this._streamOut) ? this._streamOut : void 0;
const t = this._streamErr && !j.has(this._streamErr) ? this._streamErr : void 0;
if (!e && !t) return;
setImmediate(() => {
e?.destroy();
t?.destroy();
});
};
_onClose = () => {

@@ -365,5 +348,5 @@ if (this._resolveClose) this._resolveClose();

};
function R(e, r, i) {
function L(e, r, i) {
const a = {
...N,
...M,
...i

@@ -409,10 +392,10 @@ };

}
const z = (e, t, n) => {
const r = new L(e, t, n);
const R = (e, t, n) => {
const r = new I(e, t, n);
r.spawn();
return r;
};
const B = z;
const V = R;
const z = R;
const B = L;
//#endregion
export { L as ExecProcess, k as NonZeroExitError, B as exec, V as execSync, D as normalizeSpawnCommand, z as x, R as xSync };
export { I as ExecProcess, k as NonZeroExitError, z as exec, B as execSync, D as normalizeSpawnCommand, R as x, L as xSync };
{
"name": "tinyexec",
"version": "1.2.3",
"version": "1.2.4",
"type": "module",

@@ -5,0 +5,0 @@ "description": "A minimal library for executing processes in Node",