summaryrefslogtreecommitdiff
path: root/deps/npm/lib/ci.js
blob: e71d89cfddb2f8ac80ee368be008de3d75b2cea3 (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
38
39
40
'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) => {
        npmlog.disableProgress()
        console.error(`added ${details.pkgCount} packages in ${
          details.runTime / 1000
        }s`)
      }
    )
    .then(() => cb(), cb)
}