(Note: I'm using the cowsay module here to illustrate my point)
Without installing a module on my computer I can run it directly via npx with:
npx cowsay Hello!
If I have multiple binaries specified in package.json
.
"bin": {
"cowsay": "./cli.js",
"cowthink": "./cli.js"
},
I'd also like to do
npx cowthink Hello!
But this fails. Is this because npx runs the module named cowsay
and just runs the first command it finds in the "bin"
field in package.json
?
Is there a way to run cowthink
directly from npx
?