libnpmexec

Programmatic API for npm exec (npx) command execution

npmmacoslinuxwindows
Try with needOr install directly
Source

About

npm exec (npx) programmatic API

Commands

libnpmexec

Examples

Execute a package binary with arguments programmatically$ node -e "const exec = require('libnpmexec'); exec({args: ['lodash-cli', 'help']})"
Run a locally installed package command with custom options$ node -e "const exec = require('libnpmexec'); exec({args: ['prettier', '--write', 'file.js'], localBin: './node_modules/.bin'})"
Execute npm package from registry in Node.js script$ node -e "const exec = require('libnpmexec'); exec({args: ['typescript', '--version']})"