UNPKG

840 BJavaScriptView Raw
1'use strict'
2
3const Installer = require('libcipm')
4const lifecycleOpts = require('./config/lifecycle.js')
5const npm = require('./npm.js')
6const npmlog = require('npmlog')
7const pacoteOpts = require('./config/pacote.js')
8
9ci.usage = 'npm ci'
10
11ci.completion = (cb) => cb(null, [])
12
13Installer.CipmConfig.impl(npm.config, {
14 get: npm.config.get,
15 set: npm.config.set,
16 toLifecycle (moreOpts) {
17 return lifecycleOpts(moreOpts)
18 },
19 toPacote (moreOpts) {
20 return pacoteOpts(moreOpts)
21 }
22})
23
24module.exports = ci
25function ci (args, cb) {
26 return new Installer({
27 config: npm.config,
28 log: npmlog
29 })
30 .run()
31 .then(
32 (details) => {
33 npmlog.disableProgress()
34 console.error(`added ${details.pkgCount} packages in ${
35 details.runTime / 1000
36 }s`)
37 }
38 )
39 .then(() => cb(), cb)
40}
41
\No newline at end of file