INSTALL
Type:
Version:
- Static
- Latest Patch
- Latest Minor
- Latest Major
- 10.1.4
- 10.1.3
- 10.1.2
- 10.1.1
- 10.1.0
- 10.0.0
- 9.0.1
- 9.0.0
- 8.1.4
- 8.1.3
- 8.1.2
- 8.1.1
- 8.1.0
- 8.0.0
- 7.0.10
- 7.0.9
- 7.0.8
- 7.0.7
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.0.5
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.0.17
- 5.0.16
- 5.0.15
- 5.0.14
- 5.0.13
- 5.0.12
- 5.0.11
- 5.0.10
- 5.0.9
- 5.0.8
- 5.0.7
- 5.0.6
- 5.0.5
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.0.14
- 4.0.13
- 4.0.12
- 4.0.11
- 4.0.10
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.1
- 2.0.0
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 10.0.0-pre.1
- 10.0.0-pre.0
- 7.0.0-pre.0
- 5.0.0-pre.5
- 5.0.0-pre.4
- 5.0.0-pre.3
- 5.0.0-pre.2
- 5.0.0-pre.1
- 5.0.0-pre.0
libnpmexec
The npm exec
(npx
) Programmatic API
Install
npm install libnpmexec
Usage:
const libexec = require('libnpmexec')
await libexec({
args: ['yosay', 'Bom dia!'],
cache: '~/.npm/_cacache',
npxCache: '~/.npm/_npx',
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 StringnpxCache
: The path location to where the npx cache folder is placed Stringchalk
: Chalk instance to use for colors? RequiredlocalBin
: Location to thenode_modules/.bin
folder of the local project to start scanning for bin files String, defaults to./node_modules/.bin
. libexec will walk up the directory structure looking fornode_modules/.bin
folders in parent folders that might satisfy the currentarg
and will use that bin if found.locationMsg
: Overrides "at location" message when entering interactive mode StringglobalBin
: Location to the global space bin folder, same as:$(npm bin -g)
String, defaults to empty string.packages
: 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 String, defaults tosh
on POSIX systems,process.env.ComSpec
ORcmd
on Windowsyes
: 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