README
Nupdate
Update node modules dependecy to last version in package.json
.
For bower you could use bupdate. Same as:
Install
npm i nupdate -g
How to use?
Update spawnify
to latest version:
nupdate spawnify
Update to known version:
nupdate eslint:8.0.0-beta.0
Options
Usage: nupdate [pattern] [options]
Options:
-v, --version - show version number and exit
-h, --help - show help and exit
-D, --dev - update development dependencies
-E, --save-exact - save exact version of a dependency
-i, --install - install dependency after updating
-c, --commit - create commit with updated dependency
-a, --add - add absent dependency
-r, --remove - remove dependency
-*, --set-any - set * as dependency version
--public - set publichConfig access='public'
--restricted - set publichConfig access='restricted'
Use as module
nupdate(name, version, info [, options])
name
- name of moduleversion
- version of a moduleinfo
- stringified content ofpackage.json
options
:dev
- update devDependenciesexact
- update to exact versionadd
- add absent dependencyremove
- remove dependencyset-any
- set*
as dependency version
import fs from 'fs';
import nupdate from 'nupdate';
const info = fs.readFileSync('package.json', 'utf8');
nupdate('eslint', '4.0.0', info);
// returns
({
devDendencies: {
eslint: "4.0.0",
},
});
License
MIT