Package Exports
- npm-up
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (npm-up) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
npm-up
Check the latest version of dependencies on npm gracefully, and do whatever you want.
Installation
npm i npm-up -gUsage
Run
npm-up [options]in a project directory with apackage.jsonfile. For example:npm-up -iw.
If no options are configured, it will only check the latest version and do nothing but display.Run
npm-up -gto check globally npm packages.Run
npm-up -Ato check all projects in sub directories.
commands:
clean clean cache
dump dump cacheOptions:
-h, --help output usage information
-V, --version output the version number
-g, --global Check global packages
-A, --All Check all projects in sub directories, depth is 1
-w, --writeBack Write updated version back to package.json
-i, --install Install the latest version of the packages
-l, --lock Use specific versions in package.json, with no ranges. (except *)
--lock-all Lock, even for * version
-a, --all Shortcut for -wil
-m, --mirror <mirror host or name> Use a mirror registry host
--no-cache Disable version cache temporarily
--no-warning Disable warning
-b, --backup [fileName] Backup package.json before writing back, default name is package.bak.json
-d, --dep Check dependencies only
-D, --dev Check devDependencies only
-s, --silent Do not print any log
-c, --cwd <cwd> Set current working directory
-L, --logLevel <level> Set loglevel for npm, default is error
-e, --exclude <list> Excluded packages list, split by comma or space
-o, --only <list> Included packages list, split by comma or spaceUse mirror registry
First of all, You can use something like
npm config set registry http://registry.npm.taobao.orgto set a npm registry globally to speed up npm's requests, such as version searching and package downloading, especially for Chinese users.
However, it may cause some trouble (you can't publish unless use -reg every time, because a mirror is usually read-only).
In npm-up
- You can use a built-in host with name:
npm-up -m taobao # also suport cnpmjs, npm (official)- or give a specific hostname
npm-up -m http://registry.npm.taobao.org
npm-up -m registry.npm.taobao.org # http:// is optionalFor Chinese users, use
-m taobaoto fly up!
Version Patterns
Fully support semantic versions. Eg:
*
^1.5.4
~2.3
0.9.7
0.5.0-alpha1
'' //regard as *Notice that a ranges version may be overridden by Caret Ranges(^) when written back, and will be updated only when the latest version is greater than all the versions possible in the range.
>= 1.0.0 <= 1.5.4 // Version Range
1.2 - 2.3.4 // Hyphen Ranges
1.x // X-Ranges- However, the semantic meaning of the ranges may somehow be ignored, because I just want the latest version.
- If the version declared in the
package.jsonis not recognizable, the corresponding package will be excluded. - More info: semver
Rules
Take 3 versions into consideration for one package:
- Version declared in
package.json. - Version of the package installed.
- The latest version of the package.
- Version declared in
If a package is not installed, only
package.jsonwill be updated, and the package itself won't be installed.If the version declared is
*, it will not be overwritten, even when the flag--lockis set. If you really want to change it, use--lock-allflag.The prefix
^ ~of the version will be preserved when written back, unless flag--lockis set.If an installed package's version is different from the version declared, there comes a warning.
Installed version is preferred.
Roadmap
- Use a config file to provide some persist options, like npmrc, we can have a real npmuprc.
License
MIT@Jingchen Zhao