37 GB
4,042,753 files
Updated about 1 month ago
Name
Size
src
tests
CHANGELOG.md1.92 kB
xet
README.md1.97 kB
xet
deno.json389 Bytes
xet
mod.ts463 Bytes
xet
README.md

@zuke/npx

Typed npx package-runner task wrappers for Zuke builds — download and execute a package binary in one step (npm's sibling of bun x and pnpm dlx).

import { NpxTasks } from "@zuke/npx";

await NpxTasks.npx((s) => s.command("cowsay").yes().execArgs("hello"));

API

Full typed API — generated from deno doc
`@zuke/npx` — typed `NpxTasks` wrappers for the `npx` package runner, for use
in Zuke build targets (including builds that drive Node projects).

```ts
import { NpxTasks } from "@zuke/npx";

await NpxTasks.npx((s) => s.command("cowsay").yes().execArgs("hello"));
```
@module

const NpxTasks: NpxTasksApi
  Typed task functions for the `npx` package runner.

class NpxSettings extends ToolSettings
  Settings for the `npx` package runner.

  override protected defaultTool(): string
    The executable this settings object drives: `npx`.
  command(name: string): this
    The package binary to execute (required unless {@link call} is set).
  package(...specs: string[]): this
    Packages to load before running (`--package=`); repeatable.
  call(script: string): this
    Execute a string as if inside `npm run-script` (`--call`).
  yes(): this
    Auto-install a missing package without prompting (`--yes`).
  no(): this
    Never auto-install; fail if the package is missing (`--no`).
  ignoreExisting(): this
    Ignore binaries already present in `$PATH` (`--ignore-existing`).
  execArgs(...args: Array<string | number>): this
    Arguments forwarded to the command.
  override protected buildArgs(): string[]
    Assemble the `npx <command>` argv from the configured settings.

interface NpxTasksApi
  The shape of {@link NpxTasks}.

  npx(configure?: Configure<NpxSettings>): Promise<CommandOutput>
    Download and execute a package binary: `npx <command>`.
Total size
37 GB
Files
4,042,753
Last updated
Oct 24
Pre-warmed CDN
US EU US EU

Contributors