summaryrefslogtreecommitdiff
path: root/deps/npm/lib/ci.js
blob: 6a3183d97772a3d8567fa96f2996d601ea839838 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
'use strict'

const Installer = require('libcipm')
const lifecycleOpts = require('./config/lifecycle.js')
const npm = require('./npm.js')
const npmlog = require('npmlog')
const pacoteOpts = require('./config/pacote.js')

ci.usage = 'npm ci'

ci.completion = (cb) => cb(null, [])

Installer.CipmConfig.impl(npm.config, {
  get: npm.config.get,
  set: npm.config.set,
  toLifecycle (moreOpts) {
    return lifecycleOpts(moreOpts)
  },
  toPacote (moreOpts) {
    return pacoteOpts(moreOpts)
  }
})

module.exports = ci
function ci (args, cb) {
  return new Installer({
    config: npm.config,
    log: npmlog
  })
  .run()
  .then(
    (details) => console.error(`added ${details.pkgCount} packages in ${
      details.runTime / 1000
    }s`)
  )
  .then(() => cb(), cb)
}