pnpm dlx
Aliases: pnpx
is an alias for pnpm dlx
Recupera un pacchetto dal registro senza installarlo come dipendenza, lo carica a caldo ed esegue qualsiasi comando binario predefinito che espone.
For example, to use create-vue
anywhere to bootstrap a Vue project without needing to install it under another project, you can run:
pnpm dlx create-vue my-app
This will fetch create-vue
from the registry and run it with the given arguments.
Puoi anche specificare quale versione esatta del pacchetto desideri utilizzare:
pnpm dlx create-vue@next my-app
Opzioni
--package <nome>
Il pacchetto da installare prima di eseguire il comando.
Esempio:
pnpm --package=@pnpm/meta-updater dlx meta-updater --help
pnpm --package=@pnpm/meta-updater@0 dlx meta-updater --help
È possibile fornire più pacchetti per l'installazione:
pnpm --package=yo --package=generator-webapp dlx yo webapp --skip-install
--allow-build
Added in: v10.2.0
A list of package names that are allowed to run postinstall scripts during installation.
Esempio:
pnpm --allow-build=esbuild my-bundler bundle
The actual packages executed by dlx
are allowed to run postinstall scripts by default. So if in the above example my-bundler
has to be built before execution, it will be built.
--shell-mode, -c
Esegue il comando all'interno di una shell. Utilizza /bin/sh
su UNIX e \cmd.exe
su Windows.
Esempio:
pnpm --package cowsay --package lolcatjs -c dlx 'echo "hi pnpm" | cowsay | lolcatjs'
--silent, -s
Viene stampato solo l'output del comando eseguito.