• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1const PackageJson = require('@npmcli/package-json')
2const runScriptPkg = require('./run-script-pkg.js')
3const validateOptions = require('./validate-options.js')
4const isServerPackage = require('./is-server-package.js')
5
6const runScript = async options => {
7  validateOptions(options)
8  if (options.pkg) {
9    return runScriptPkg(options)
10  }
11  const { content: pkg } = await PackageJson.normalize(options.path)
12  return runScriptPkg({ ...options, pkg })
13}
14
15module.exports = Object.assign(runScript, { isServerPackage })
16