Icard/angular-clarity-master(work.../node_modules/@npmcli/run-script/lib/run-script.js

15 lines
516 B
JavaScript
Raw Normal View History

2024-07-16 14:55:36 +00:00
const rpj = require('read-package-json-fast')
const runScriptPkg = require('./run-script-pkg.js')
const validateOptions = require('./validate-options.js')
const isServerPackage = require('./is-server-package.js')
const runScript = options => {
validateOptions(options)
const { pkg, path } = options
return pkg ? runScriptPkg(options)
: rpj(path + '/package.json')
.then(readPackage => runScriptPkg({ ...options, pkg: readPackage }))
}
module.exports = Object.assign(runScript, { isServerPackage })