zuke.tools.npx

← Python API reference

@zuke/npx 1.1.0: @zuke/npx — typed NpxTasks wrappers for the npx package runner, for use in Zuke build targets (including builds that drive Node projects).

Symbols

#

NpxSettings

class
class NpxSettings(ToolSettings)

Settings for the npx package runner.

  • command(name: str) -> Self

    The package binary to execute (required unless call is set).

  • package(*specs: str) -> Self

    Packages to load before running (--package=); repeatable.

  • call(script: str) -> Self

    Execute a string as if inside npm run-script (--call).

  • yes() -> Self

    Auto-install a missing package without prompting (--yes).

  • no() -> Self

    Never auto-install; fail if the package is missing (--no).

  • ignore_existing() -> Self

    Ignore binaries already present in $PATH (--ignore-existing).

  • exec_args(*args: str | float) -> Self

    Arguments forwarded to the command.

#

NpxTasks

class
class NpxTasks

Typed task functions for the npx package runner.

  • static async npx(ctx: ServiceContext, configure: Callable[[NpxSettings], NpxSettings] | None=None) -> ExecResult

    Download and execute a package binary: npx <command>.