libnpmexec

所属分类:collect
开发工具:JavaScript
文件大小:0KB
下载次数:0
上传日期:2022-01-18 21:27:57
上 传 者sh-1993
说明:  npm exec(npx)编程API,
(npm exec (npx) Programmatic API,)

文件列表:
.editorconfig (44, 2022-01-18)
.eslintrc.json (7768, 2022-01-18)
CHANGELOG.md (520, 2022-01-18)
CONTRIBUTING.md (3423, 2022-01-18)
LICENSE (741, 2022-01-18)
lib/ (0, 2022-01-18)
lib/cache-install-dir.js (510, 2022-01-18)
lib/file-exists.js (662, 2022-01-18)
lib/get-bin-from-manifest.js (628, 2022-01-18)
lib/index.js (5808, 2022-01-18)
lib/is-windows.js (46, 2022-01-18)
lib/manifest-missing.js (536, 2022-01-18)
lib/no-tty.js (44, 2022-01-18)
lib/run-script.js (1881, 2022-01-18)
package-lock.json (474192, 2022-01-18)
package.json (1496, 2022-01-18)
tap-snapshots/ (0, 2022-01-18)
tap-snapshots/test/ (0, 2022-01-18)
tap-snapshots/test/run-script.js.test.cjs (741, 2022-01-18)
test/ (0, 2022-01-18)
test/cache-install-dir.js (269, 2022-01-18)
test/file-exists.js (380, 2022-01-18)
test/get-bin-from-manifest.js (865, 2022-01-18)
test/index.js (17625, 2022-01-18)
test/manifest-missing.js (684, 2022-01-18)
test/registry/ (0, 2022-01-18)
... ...

# We've Moved! The code for this repo is now a workspace in the npm CLI repo. [github.com/npm/cli](https://github.com/npm/cli) You can find the workspace in /workspaces/libnpmexec Please file bugs and feature requests as issues on the CLI and tag the issue with "ws:libnpmexec". [github.com/npm/cli/issues](https://github.com/npm/cli) # libnpmexec [![npm version](https://img.shields.io/npm/v/libnpmexec.svg)](https://npm.im/libnpmexec) [![license](https://img.shields.io/npm/l/libnpmexec.svg)](https://npm.im/libnpmexec) [![GitHub Actions](https://github.com/npm/libnpmexec/workflows/node-ci/badge.svg)](https://github.com/npm/libnpmexec/actions?query=workflow%3Anode-ci) [![Coverage Status](https://coveralls.io/repos/github/npm/libnpmexec/badge.svg?branch=main)](https://coveralls.io/github/npm/libnpmexec?branch=main) The `npm exec` (`npx`) Programmatic API ## Install `npm install libnpmexec` ## Usage: ```js 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 using `packages` option **String**, defaults to empty string. - `cache`: The path location to where the npm cache folder is placed **String** - `npxCache`: The path location to where the npx cache folder is placed **String** - `color`: Output should use color? **Boolean**, defaults to `false` - `localBin`: Location to the `node_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 for `node_modules/.bin` folders in parent folders that might satisfy the current `arg` and will use that bin if found. - `locationMsg`: Overrides "at location" message when entering interactive mode **String** - `log`: Sets an optional logger **Object**, defaults to `proc-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 **Function** - `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 to `sh` on POSIX systems, `process.env.ComSpec` OR `cmd` on Windows - `yes`: Should skip download confirmation prompt when fetching missing packages from the registry? **Boolean** - `registry`, `cache`, and more options that are forwarded to [@npmcli/arborist](https://github.com/npm/arborist/) and [pacote](https://github.com/npm/pacote/#options) **Object** ## LICENSE [ISC](./LICENSE)

近期下载者

相关文件


收藏者