【文件属性】:
文件名称:package-run:以编程方式运行package.json脚本。 支持yarn,npm和pnpm
文件大小:148KB
文件格式:ZIP
更新时间:2021-04-17 22:18:46
TypeScript
打包运行
用于运行package.json脚本的节点API。
如果存在锁定文件,脚本将使用正确的程序包管理器(yarn,npm或pnpm)自动运行。
对于npm,如果packge.json中存在给定脚本,它将使用npm run 。 否则,将使用npx --no-install 。
安装
yarn add package-run
npm install package-run
原料药
用法
import run , { executableToString } from "package-run" ;
run ( {
command : "babel" ,
args : [
"./src" ,
{
"out-dir" : "./build" ,
"config-file" : "./babel.config.json" ,
"
【文件预览】:
package-run-master
----.gitignore(55B)
----tsconfig.json(69B)
----README.md(4KB)
----CHANGELOG.md(3KB)
----test()
--------index.test.ts(1KB)
--------npm.test.ts(942B)
----source()
--------index.ts(2KB)
----package.json(1KB)
----yarn.lock(376KB)