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
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2017-05-25 21:25:49 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:32 +0300
commit4df59348d5abb6ca4b2786ef73a22c67120ac95d (patch)
tree1073a7552658216a5bcbfd1cea8c52909558df2a /lib
parent80202cd4d6b7dd4f136d93a7000eeb8fd1456aa3 (diff)
pkglock: add --no-package-lock option as --no-shrinkwrap alias
Diffstat (limited to 'lib')
-rw-r--r--lib/config/defaults.js2
-rw-r--r--lib/install/inflate-shrinkwrap.js4
-rw-r--r--lib/install/save.js3
3 files changed, 8 insertions, 1 deletions
diff --git a/lib/config/defaults.js b/lib/config/defaults.js
index 391419a1c..da019ac4d 100644
--- a/lib/config/defaults.js
+++ b/lib/config/defaults.js
@@ -178,6 +178,7 @@ Object.defineProperty(exports, 'defaults', {get: function () {
'onload-script': false,
only: null,
optional: true,
+ 'package-lock': true,
parseable: false,
'prefer-offline': false,
'prefer-online': false,
@@ -305,6 +306,7 @@ exports.types = {
'onload-script': [null, String],
only: [null, 'dev', 'development', 'prod', 'production'],
optional: Boolean,
+ 'package-lock': Boolean,
parseable: Boolean,
'prefer-offline': Boolean,
'prefer-online': Boolean,
diff --git a/lib/install/inflate-shrinkwrap.js b/lib/install/inflate-shrinkwrap.js
index 596885613..02f7eaedd 100644
--- a/lib/install/inflate-shrinkwrap.js
+++ b/lib/install/inflate-shrinkwrap.js
@@ -15,7 +15,9 @@ const validate = require('aproba')
const path = require('path')
module.exports = function (tree, swdeps, opts, finishInflating) {
- if (!npm.config.get('shrinkwrap')) return finishInflating()
+ if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) {
+ return finishInflating()
+ }
if (arguments.length === 3) {
finishInflating = opts
opts = {}
diff --git a/lib/install/save.js b/lib/install/save.js
index 044b12023..56a4a892a 100644
--- a/lib/install/save.js
+++ b/lib/install/save.js
@@ -43,6 +43,9 @@ function andWarnErrors (cb) {
function saveShrinkwrap (tree, next) {
validate('OF', arguments)
+ if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) {
+ next()
+ }
createShrinkwrap(tree, {silent: false}, next)
}