diff --git a/runtime/reference/cli/x.md b/runtime/reference/cli/x.md index 507697ea1..b3e0bd94c 100644 --- a/runtime/reference/cli/x.md +++ b/runtime/reference/cli/x.md @@ -45,6 +45,23 @@ Run a JSR package: deno x jsr:@std/http/file-server ``` +## Specifying the package separately from the binary + +Some npm packages expose multiple binaries — `typescript` ships both `tsc` and +`tsserver`, for example. Starting in Deno 2.8, `--package` (`-p`) lets you +choose the package and the binary independently, matching the +`npx -p ` convention: + +```sh +# Run `tsc` from the typescript package +deno x -p typescript tsc + +# Pin the package version +deno x -p typescript@5 tsc +``` + +The previous form `deno x typescript/tsc` still works. + ## How it works `deno x` downloads the package to the global cache (if not already cached),