Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

zx

Package Overview
Dependencies
Maintainers
0
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zx - npm Package Compare versions

Comparing version 8.1.2 to 8.1.3-dev.d6f5493

14

build/cli.d.ts
#!/usr/bin/env node
export {};
import { minimist } from './index.js';
export declare function printUsage(): void;
export declare const argv: minimist.ParsedArgs;
export declare function main(): Promise<void>;
export declare function runScript(script: string): Promise<void>;
export declare function scriptFromStdin(): Promise<boolean>;
export declare function scriptFromHttp(remote: string): Promise<void>;
export declare function writeAndImport(script: string | Buffer, filepath: string, origin?: string): Promise<void>;
export declare function importPath(filepath: string, origin?: string): Promise<void>;
export declare function injectGlobalRequire(origin: string): void;
export declare function transformMarkdown(buf: Buffer): string;
export declare function getVersion(): string;
export declare function isMain(metaurl?: string, scriptpath?: string): boolean;
#!/usr/bin/env node
"use strict";
import './deno.js'
import { require } from './deno.js'
const {
} = await import('./cli.cjs')
argv,
getVersion,
importPath,
injectGlobalRequire,
isMain,
main,
printUsage,
runScript,
scriptFromHttp,
scriptFromStdin,
transformMarkdown,
writeAndImport
} = require('./cli.cjs')
export {
argv,
getVersion,
importPath,
injectGlobalRequire,
isMain,
main,
printUsage,
runScript,
scriptFromHttp,
scriptFromStdin,
transformMarkdown,
writeAndImport
}

17

build/core.d.ts

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

import { spawn, spawnSync, StdioOptions, IOType } from 'node:child_process';
import { type StdioOptions, type IOType, spawn, spawnSync } from 'node:child_process';
import { type Encoding } from 'node:crypto';
import { Readable, Writable } from 'node:stream';
import { type Readable, type Writable } from 'node:stream';
import { inspect } from 'node:util';
import { RequestInfo, RequestInit } from './vendor.js';
import { Duration, noop, quote } from './util.js';
import { type RequestInfo, type RequestInit, type TSpawnStore } from './vendor.js';
import { type Duration, noop, quote } from './util.js';
export interface Shell {

@@ -34,3 +34,3 @@ (pieces: TemplateStringsArray, ...args: any[]): ProcessPromise;

postfix: string;
quote: typeof quote;
quote?: typeof quote;
quiet: boolean;

@@ -41,2 +41,3 @@ detached: boolean;

spawnSync: typeof spawnSync;
store?: TSpawnStore;
log: typeof log;

@@ -127,8 +128,8 @@ kill: typeof kill;

export type LogEntry = {
verbose?: boolean;
} & ({
kind: 'cmd';
verbose: boolean;
cmd: string;
} | {
kind: 'stdout' | 'stderr';
verbose: boolean;
data: Buffer;

@@ -148,4 +149,4 @@ } | {

data: any;
};
});
export declare function log(entry: LogEntry): void;
export {};
"use strict";
import './deno.js'
import { require } from './deno.js'
const {

@@ -16,3 +16,3 @@ $,

within
} = await import('./core.cjs')
} = require('./core.cjs')
export {

@@ -19,0 +19,0 @@ $,

@@ -1,8 +0,13 @@

import './deno.js'
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const __filename = new URL(import.meta.url).pathname
const __dirname = new URL('.', import.meta.url).pathname
if (globalThis.Deno) {
globalThis.require = createRequire(import.meta.url)
globalThis.__filename = new URL(import.meta.url).pathname
globalThis.__dirname = new URL('.', import.meta.url).pathname
globalThis.require = require
globalThis.__filename = __filename
globalThis.__dirname = __dirname
}
export { require, __dirname, __filename }
"use strict";
import './deno.js'
import { require } from './deno.js'
const {
installDeps,
parseDeps
} = await import('./deps.cjs')
} = require('./deps.cjs')
export {

@@ -8,0 +8,0 @@ installDeps,

@@ -22,2 +22,3 @@ import * as _ from './index.js';

var path: typeof _.path;
var ps: typeof _.ps;
var question: typeof _.question;

@@ -31,2 +32,3 @@ var quiet: typeof _.quiet;

var stdin: typeof _.stdin;
var syncProcessCwd: typeof _.syncProcessCwd;
var tempdir: typeof _.tempdir;

@@ -36,2 +38,3 @@ var tempfile: typeof _.tempfile;

var tmpfile: typeof _.tempfile;
var updateArgv: typeof _.updateArgv;
var usePowerShell: typeof _.usePowerShell;

@@ -38,0 +41,0 @@ var usePwsh: typeof _.usePwsh;

"use strict";
import './deno.js'
import { require } from './deno.js'
const {
} = await import('./globals.cjs')
} = require('./globals.cjs')
export {

@@ -7,0 +7,0 @@

import { type Duration } from './util.js';
import { minimist, RequestInfo, RequestInit } from './vendor.js';
import { minimist, type RequestInfo, type RequestInit } from './vendor.js';
export { default as path } from 'node:path';

@@ -4,0 +4,0 @@ export * as os from 'node:os';

"use strict";
import './deno.js'
import { require } from './deno.js'
const {

@@ -16,3 +16,3 @@ argv,

updateArgv
} = await import('./goods.cjs')
} = require('./goods.cjs')
export {

@@ -19,0 +19,0 @@ argv,

"use strict";
import './deno.js'
import { require } from './deno.js'
const {

@@ -44,3 +44,3 @@ YAML,

updateArgv
} = await import('./index.cjs')
} = require('./index.cjs')
export {

@@ -47,0 +47,0 @@ YAML,

"use strict";
import './deno.js'
import { require } from './deno.js'
const {
startRepl
} = await import('./repl.cjs')
} = require('./repl.cjs')
export {

@@ -7,0 +7,0 @@ startRepl

@@ -11,3 +11,2 @@ export declare function tempdir(prefix?: string): string;

export declare function normalizeMultilinePieces(pieces: TemplateStringsArray): TemplateStringsArray;
export declare function noquote(): string;
export declare function quote(arg: string): string;

@@ -14,0 +13,0 @@ export declare function quotePowerShell(arg: string): string;

"use strict";
import './deno.js'
import { require } from './deno.js'
const {

@@ -11,3 +11,2 @@ errnoMessage,

noop,
noquote,
normalizeMultilinePieces,

@@ -21,3 +20,3 @@ parseDuration,

tempfile
} = await import('./util.cjs')
} = require('./util.cjs')
export {

@@ -31,3 +30,2 @@ errnoMessage,

noop,
noquote,
normalizeMultilinePieces,

@@ -34,0 +32,0 @@ parseDuration,

@@ -321,2 +321,14 @@ // Generated by dts-bundle-generator v9.5.1

type TSpawnError = any;
type TPushable<T = any> = {
push(...args: T[]): number;
};
type TJoinable = {
join(sep?: string): string;
};
type TSpawnStoreChunks = Iterable<string | Buffer> & TPushable<string | Buffer> & TJoinable;
export type TSpawnStore = {
stdout: TSpawnStoreChunks;
stderr: TSpawnStoreChunks;
stdall: TSpawnStoreChunks;
};
type TSpawnResult = {

@@ -367,2 +379,3 @@ stderr: string;

spawnOpts: Record<string, any>;
store: TSpawnStore;
callback: (err: TSpawnError, result: TSpawnResult) => void;

@@ -577,30 +590,18 @@ stdin: Readable;

export declare const chalk: ChalkInstance;
/** Finds all instances of a specified executable in the PATH environment variable */
export declare function which(cmd: string, options: which.Options & which.AsyncOptions & which.OptionsAll): Promise<string[]>;
export declare function which(cmd: string, options?: which.Options & which.AsyncOptions & which.OptionsFirst): Promise<string>;
type AppendNullIfNothrow<TOptions, TRet> = TOptions extends {
nothrow: infer TVal;
} ? TVal extends false ? TRet : TRet | null : TRet;
type TransformToArrayIfAll<TOptions, TRet> = TOptions extends {
all: infer TVal;
} ? TVal extends true ? readonly TRet[] : TVal extends false ? TRet : readonly TRet[] | TRet : TRet;
type ReturnType$1<TOptions> = AppendNullIfNothrow<TOptions, TransformToArrayIfAll<TOptions, string>>;
type Exact<T, U extends T> = {
[Key in keyof U]: Key extends keyof T ? U[Key] : never;
};
export declare function which<TOptions extends which.Options>(cmd: string, options?: Exact<which.Options, TOptions>): Promise<ReturnType$1<Exact<which.Options, TOptions>>>;
export declare namespace which {
/** Finds all instances of a specified executable in the PATH environment variable */
function sync(cmd: string, options: Options & OptionsAll & OptionsNoThrow): readonly string[] | null;
function sync(cmd: string, options: Options & OptionsFirst & OptionsNoThrow): string | null;
function sync(cmd: string, options: Options & OptionsAll & OptionsThrow): readonly string[];
function sync(cmd: string, options?: Options & OptionsFirst & OptionsThrow): string;
function sync(cmd: string, options: Options): string | readonly string[] | null;
/** Options that ask for all matches. */
interface OptionsAll extends AsyncOptions {
all: true;
}
/** Options that ask for the first match (the default behavior) */
interface OptionsFirst extends AsyncOptions {
all?: false | undefined;
}
/** Options that ask to receive null instead of a thrown error */
interface OptionsNoThrow extends Options {
nothrow: true;
}
/** Options that ask for a thrown error if executable is not found (the default behavior) */
interface OptionsThrow extends Options {
nothrow?: false | undefined;
}
/** Options for which() async API */
interface AsyncOptions {
function sync<TOptions extends Options>(cmd: string, options?: Exact<Options, TOptions>): ReturnType$1<Exact<Options, TOptions>>;
/** Options for which() API */
interface Options {
/** If true, return all matches, instead of just the first one. Note that this means the function returns an array of strings instead of a single string. */

@@ -612,5 +613,4 @@ all?: boolean | undefined;

pathExt?: string | undefined;
}
/** Options for which() sync and async APIs */
interface Options extends AsyncOptions {
/** Use instead of the platform's native path separator. */
delimiter?: string | undefined;
/** If true, returns null when not found */

@@ -730,5 +730,13 @@ nothrow?: boolean | undefined;

declare const _default: {
lookup: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => Promise<TPsLookupEntry[]>;
kill: (pid: string | number, opts?: string | number | TPsKillOptions | TPsNext | undefined, next?: TPsNext | undefined) => Promise<void>;
tree: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback) => Promise<TPsLookupEntry[]>;
lookup: {
(query?: TPsLookupQuery, cb?: TPsLookupCallback): Promise<TPsLookupEntry[]>;
sync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[];
};
lookupSync: (query?: TPsLookupQuery, cb?: TPsLookupCallback) => TPsLookupEntry[];
tree: {
(opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined): Promise<TPsLookupEntry[]>;
sync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined) => TPsLookupEntry[];
};
treeSync: (opts?: string | number | TPsTreeOpts | undefined, cb?: TPsLookupCallback | undefined) => TPsLookupEntry[];
};

@@ -735,0 +743,0 @@ export declare const createRequire: (filename: string | URL$1) => NodeRequire;

"use strict";
import './deno.js'
import { require } from './deno.js'
const {

@@ -18,3 +18,3 @@ YAML,

which
} = await import('./vendor.cjs')
} = require('./vendor.cjs')
export {

@@ -21,0 +21,0 @@ YAML,

{
"name": "zx",
"version": "8.1.2",
"version": "8.1.3-dev.d6f5493",
"description": "A tool for writing better scripts",

@@ -88,4 +88,4 @@ "type": "module",

"optionalDependencies": {
"@types/fs-extra": "^11.0.4",
"@types/node": ">=20.12.12"
"@types/fs-extra": ">=11",
"@types/node": ">=20"
},

@@ -96,5 +96,5 @@ "devDependencies": {

"@types/node": ">=20.11.30",
"@types/which": "^3.0.3",
"@types/which": "^3.0.4",
"@webpod/ingrid": "^0.0.0-beta.3",
"@webpod/ps": "^0.0.0-beta.3",
"@webpod/ps": "^0.0.0-beta.7",
"c8": "^9.1.0",

@@ -105,3 +105,3 @@ "chalk": "^5.3.0",

"dts-bundle-generator": "^9.5.1",
"esbuild": "^0.21.4",
"esbuild": "^0.21.5",
"esbuild-node-externals": "^1.13.1",

@@ -118,12 +118,11 @@ "esbuild-plugin-entry-chunks": "^0.1.15",

"minimist": "^1.2.8",
"node-abort-controller": "^3.1.1",
"node-fetch-native": "^1.6.4",
"prettier": "^3.2.5",
"prettier": "^3.3.2",
"ts-node": "^10.9.2",
"tsd": "^0.31.0",
"tsx": "^4.11.0",
"tsd": "^0.31.1",
"tsx": "^4.15.6",
"typescript": "^5.4.5",
"which": "^4.0.0",
"yaml": "^2.4.2",
"zurk": "^0.1.4"
"yaml": "^2.4.5",
"zurk": "^0.3.0"
},

@@ -130,0 +129,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc