diff options
author | Thorsten Lorenz <thlorenz@gmx.de> | 2014-03-29 06:22:43 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-04-10 21:50:32 +0400 |
commit | 64eefdfe26bb27db8dc90e3ab5d27a5ef18a4470 (patch) | |
tree | c2db15c702921e378c0943258683b73a2f34e3f4 /doc | |
parent | 4a5257de3870ac3dafa39667379f19f6dcd6093e (diff) |
adding save-prefix configuration option
- npm install --save|--save-dev takes npm.config['save-prefix'] into
account when prefixing the version in the package.json
- by default the version is prefixed with '^'
- added tests for this feature
- added documentation for this feature including one example
- tests are passing without npmconf changes, but this commit goes alongside [e045042] in npmconf repo
Diffstat (limited to 'doc')
-rw-r--r-- | doc/misc/npm-config.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/misc/npm-config.md b/doc/misc/npm-config.md index e54e2bb7b..a70de8121 100644 --- a/doc/misc/npm-config.md +++ b/doc/misc/npm-config.md @@ -648,6 +648,19 @@ devDependencies hash. Only works if there is already a package.json file present. +### save-prefix + +* Default: '^' +* Type: String + +Configure how versions of packages installed to a package.json file via +`--save` or `--save-dev` get prefixed. + +For example if a package has version `1.2.3`, by default it's version is +set to `^1.2.3` which allows minor upgrades for that package, but after +`npm config set save-prefix='~'` it would be set to `~1.2.3` which only allows +patch upgrades. + ### searchopts * Default: "" |