What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Deno’s deno x command runs package-provided command-line tools on demand, without first installing them globally. Use deno x npm:<package> for an npm package, or a runnable jsr: subpath for a JSR package. Choose deno install when you want a tool to remain available as a command, or compile it when you need a standalone executable.

Run an npm binary on demand

For an npm package that exposes a command-line binary, use:

deno x npm:<package>

For example, replace <package> with the package name. Deno’s documentation explains that npm packages expose runnable binaries through the bin field in their package.json. If the package publishes several binaries, specify the desired command with -p:

deno x -p <package> <binary>

A package/binary subpath is another documented way to select a binary. Check the package’s published binary names if you are unsure which command to use. See Deno’s deno x reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run a JSR tool

A JSR package is runnable when it exposes a module entry point suitable for execution. Invoke that entry point using a documented jsr: subpath with deno x. This differs from npm’s package-binary convention: a JSR tool needs an executable module entry point, while npm binaries are exposed through the package’s bin field.

Choose between deno x, deno install, and compilation

Approach Use it for Result
deno x Running an npm or runnable JSR tool when needed On-demand execution; no prior global installation is required.
deno install A tool you want available as a regular command, or installing dependencies A persistent command or installed dependency, depending on the invocation.
Compile A tool that needs to be distributed or run as a standalone executable A standalone executable rather than an on-demand package command.

Deno’s documentation for deno x recommends deno install or compilation when you need more than an on-demand run. Consult the deno install reference for installation options.

Understand package names and dependency files

Deno supports npm and JSR in one package workflow. The deno add command accepts both registry specifiers and is an alias for deno install [PACKAGES]. In Deno 2.8, unprefixed package names supplied to deno add or deno install are treated as npm packages by default. Use jsr: to identify a JSR package explicitly. In import specifiers, npm packages still require the npm: prefix.

Where npm dependencies are recorded depends on the project:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • If the project has a package.json, npm packages added with deno add go in its dependencies.
  • Without a package.json, dependencies go in the imports field of deno.json.
  • Use --package-json to direct output to package.json. JSR packages recorded there use the npm-compatible npm:@jsr/… form.

These rules describe dependency declarations; the location of a declaration is distinct from choosing whether to run a binary on demand or make a command persistent. See Deno’s dependency management documentation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How the command fits Deno’s package workflow

Deno’s package management is built into the deno binary: use deno add to declare dependencies, deno install to install dependencies or make tools persistent, and deno x to execute package binaries on demand. JSR support and deno add arrived with Deno 1.42 on March 28, 2024; Deno 2.3 added --npm and --jsr flags for grouped additions from a registry. Deno 2.8 later changed the CLI’s default treatment of unprefixed names for deno add and deno install, while leaving the npm: requirement for import specifiers in place. The syntax distinction matters when following older examples.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.