Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/ci.js
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2018-01-08 09:00:20 +0300
committerRebecca Turner <me@re-becca.org>2018-02-20 07:19:39 +0300
commit5e4de9c99c934e25ef7b9c788244cc3c993da559 (patch)
treee965480e70bb2bf892d6bf38f62d4b9da12f92fc /lib/ci.js
parent26cd648697c1324979289e381fe837f9837f3874 (diff)
ci: add new npm ci installer
Diffstat (limited to 'lib/ci.js')
-rw-r--r--lib/ci.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/ci.js b/lib/ci.js
new file mode 100644
index 000000000..6a3183d97
--- /dev/null
+++ b/lib/ci.js
@@ -0,0 +1,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)
+}