Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .yarn/versions/b3a2d4e3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
releases:
"@yarnpkg/cli": patch
"@yarnpkg/plugin-dlx": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
13 changes: 12 additions & 1 deletion packages/plugin-dlx/sources/commands/dlx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,27 @@ export default class DlxCommand extends BaseCommand {
details: `
This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.

By default Yarn will download the package named \`command\`, but this can be changed through the use of the \`-p,--package\` flag which will instruct Yarn to still run the same command but from a different package.
By default, Yarn will download the package named \`command\` and run the binary with the same name. The \`-p,--package\` flag is only needed when the binary you want to run has a different name than the package, or when you need to install multiple packages for a single command.

Version ranges can be appended to the package name using the \`@\` suffix (e.g. \`pkg@1.0.0\` or \`pkg@^2\`). When no range is specified, Yarn will use the \`latest\` dist-tag. This works both with and without the \`-p,--package\` flag.

Using \`yarn dlx\` as a replacement of \`yarn add\` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through \`dlx\` - neither their name, nor their version).
`,
examples: [[
`Use create-vite to scaffold a new Vite project`,
`yarn dlx create-vite`,
], [
`Run a specific version of a package`,
`yarn dlx create-vite@5.0.0`,
], [
`Install multiple packages for a single command`,
`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`,
], [
`Run the \`tsc\` binary from a specific version of typescript`,
`yarn dlx -p typescript@5.0.2 tsc --version`,
], [
`Run an alternate binary (\`tsserver\`) from the same package`,
`yarn dlx -p typescript@5.0.2 tsserver`,
]],
});

Expand Down
Loading