aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/@npmcli/run-script/lib/run-script.js
blob: af33d2113f9ef0b9a04cd9a4c14ea2f54c10bce8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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(pkg => runScriptPkg({...options, pkg}))
}

module.exports = Object.assign(runScript, { isServerPackage })