NET-Web-API-w-Angular/my-app/node_modules/@npmcli/run-script/lib/run-script.js

16 lines
520 B
JavaScript
Raw Normal View History

2024-02-09 00:38:41 +00:00
const PackageJson = require('@npmcli/package-json')
const runScriptPkg = require('./run-script-pkg.js')
const validateOptions = require('./validate-options.js')
const isServerPackage = require('./is-server-package.js')
const runScript = async options => {
validateOptions(options)
if (options.pkg) {
return runScriptPkg(options)
}
const { content: pkg } = await PackageJson.normalize(options.path)
return runScriptPkg({ ...options, pkg })
}
module.exports = Object.assign(runScript, { isServerPackage })