• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict'
2
3const npm = require('../npm.js')
4const log = require('npmlog')
5
6module.exports = lifecycleOpts
7
8let opts
9
10function lifecycleOpts (moreOpts) {
11  if (!opts) {
12    opts = {
13      config: npm.config.snapshot,
14      dir: npm.dir,
15      failOk: false,
16      force: npm.config.get('force'),
17      group: npm.config.get('group'),
18      ignorePrepublish: npm.config.get('ignore-prepublish'),
19      ignoreScripts: npm.config.get('ignore-scripts'),
20      log: log,
21      nodeOptions: npm.config.get('node-options'),
22      production: npm.config.get('production'),
23      scriptShell: npm.config.get('script-shell'),
24      scriptsPrependNodePath: npm.config.get('scripts-prepend-node-path'),
25      unsafePerm: npm.config.get('unsafe-perm'),
26      user: npm.config.get('user')
27    }
28  }
29
30  return moreOpts ? Object.assign({}, opts, moreOpts) : opts
31}
32