You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, there is pnpm dlx, which as far as I can see has two forms:
pnpm dlx <PACKAGE> [ARGS...]:
temporarily install <PACKAGE>, and run its default binary with ARGS
pnpm --package=<PACKAGE> dlx <COMMAND> [ARGS...]:
temporarily install <PACKAGE> (or multiple), and run <COMMAND> with the installed package binaries added to $PATH
The assumption in form (2) is that the <COMMAND> would belong to any of the installed packages.
Is there an equivalent command that would add the installed packages to Node search path instead, such that I could run an arbitrary external script, e.g. pnpm --package=<PACKAGE> dlx /path/to/some/script.js, and do a require("PACKAGE") from that script?
If not, would that be a reasonable functionality to add to pnpm dlx?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So, there is
pnpm dlx
, which as far as I can see has two forms:pnpm dlx <PACKAGE> [ARGS...]
:temporarily install
<PACKAGE>
, and run its default binary withARGS
pnpm --package=<PACKAGE> dlx <COMMAND> [ARGS...]
:temporarily install
<PACKAGE>
(or multiple), and run<COMMAND>
with the installed package binaries added to$PATH
The assumption in form (2) is that the
<COMMAND>
would belong to any of the installed packages.Is there an equivalent command that would add the installed packages to Node search path instead, such that I could run an arbitrary external script, e.g.
pnpm --package=<PACKAGE> dlx /path/to/some/script.js
, and do arequire("PACKAGE")
from that script?If not, would that be a reasonable functionality to add to
pnpm dlx
?Beta Was this translation helpful? Give feedback.
All reactions