mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 02:59:02 +00:00
![]() PR-URL: https://github.com/nodejs/node/pull/38475 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> |
||
---|---|---|
.. | ||
lib | ||
CHANGELOG.md | ||
LICENSE | ||
package.json | ||
README.md |
libnpmexec
The npm exec
(npx
) Programmatic API
Install
npm install libnpmexec
Usage:
const libexec = require('libnpmexec')
await libexec({
args: ['yosay', 'Bom dia!'],
cache: '~/.npm',
yes: true,
})
API:
libexec(opts)
opts
:args
: List of pkgs to execute Array, defaults to[]
call
: An alternative command to run when usingpackages
option String, defaults to empty string.cache
: The path location to where the npm cache folder is placed Stringcolor
: Output should use color? Boolean, defaults tofalse
localBin
: Location to thenode_modules/.bin
folder of the local project String, defaults to empty string.locationMsg
: Overrides "at location" message when entering interactive mode Stringlog
: Sets an optional logger Object, defaults toproc-log
module usage.globalBin
: Location to the global space bin folder, same as:$(npm bin -g)
String, defaults to empty string.output
: A function to print output to Functionpackages
: A list of packages to be used (possibly fetch from the registry) Array, defaults to[]
path
: Location to where to read local project info (package.json
) String, defaults to.
runPath
: Location to where to execute the script String, defaults to.
scriptShell
: Default shell to be used Stringyes
: Should skip download confirmation prompt when fetching missing packages from the registry? Booleanregistry
,cache
, and more options that are forwarded to @npmcli/arborist and pacote Object