2.7.0 • Published 4 years ago

npm-up v2.7.0

Weekly downloads
13
License
MIT
Repository
github
Last release
4 years ago

npm-up

Check the latest versions of dependencies on npm gracefully, and do whatever you want.

NPM version Downloads Deps Build Status Build status

Installation

npm i npm-up -g

Features

  • Much faseter than npm.
  • Do not depend on a local npm, much smaller.
  • Check the latest versions of dependencies either locally or gloablly, and update package.json.
    • dependencies
    • devDependencies
    • optionalDependencies
  • Install latest modules.
  • Reasonable warnings for inconsistency.
  • Use a mirror registy to speed up, especially for Chinese users.
  • Cache to speed up repeated operations.
  • Designed for OCD.

Usage

  1. Run npm-up [options] in a project directory with a package.json file. For example: npm-up -iw. If no options are configured, it will only check the latest version and do nothing but display.

  2. Run npm-up -g to check globally npm packages.

  3. Run npm-up -A to check all projects in sub directories.

commands:

clean   clean cache
dump    dump cache

Options:

-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
--no-warning                        Disable warning
-d, --dep                           Check dependencies only
-D, --dev                           Check devDependencies only
-O, --optional                      Check optionalDependencies only
-c, --cwd <cwd>                     Set current working directory
-L, --logLevel <level>              Set loglevel for npm, default is error
-t, --tag <tag>                     Dist-tag used as the version to be updated
-e, --exclude <list>                Excluded packages list, split by comma or space
-o, --only <list>                   Included packages list, split by comma or space
-p --exclude-locked                 Exclude all locked packages
-h, --help                          output usage information

Use a mirror registry

First of all, You can use something like

npm config set registry http://registry.npm.taobao.org

to 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 using -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 optional

For Chinese users, use -m taobao to fly up!

Version Patterns

Fully support semantic versions and tags. Eg:

*
^1.5.4
~2.3.0
>= 4.4.5
0.9.7
0.5.0-alpha1
''     //regard as *
latest // dist-tag

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
  • OCD design 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.json is not recognizable, the corresponding package will be excluded.
  • More info about version: semver

Rules

  1. Take 3 versions about one package into consideration:

    • Version declared in package.json.
    • Version of the package installed.
    • The latest version of the package.
  2. If a package is not installed, only package.json will be updated, and the package itself won't be installed.

  3. If the version declared is *, it will not be overwritten, even when the flag --lock is set. If you really want to change it, use --lock-all flag.

  4. The prefix, such as ^ ~ > <, of the version will be preserved when written back, unless flag --lock is set.

  5. If an installed package's version is different from the version declared, there comes a warning.

  6. Installed version is preferred.

Roadmap

  1. Use a config file to provide some persist options, like npmrc, we can have a real npmuprc.

License

MIT@Jingchen Zhao

2.7.0

4 years ago

2.6.2

7 years ago

2.6.1

7 years ago

2.6.0

8 years ago

2.5.0

8 years ago

2.4.0

9 years ago

2.3.0

9 years ago

2.2.4

9 years ago

2.2.3

9 years ago

2.2.2

10 years ago

2.2.1

10 years ago

2.2.0

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

2.0.0-beta.3

10 years ago

2.0.0-beta.2

10 years ago

2.0.0-beta.1

10 years ago

1.9.3

10 years ago

1.9.2

10 years ago

1.9.1

10 years ago

1.9.0

10 years ago

1.8.2

10 years ago

1.8.1

10 years ago

1.8.0

10 years ago

1.7.0

10 years ago

1.6.4

10 years ago

1.6.3

10 years ago

1.6.2

10 years ago

1.6.1

10 years ago

1.6.0

10 years ago

1.5.5

10 years ago

1.5.4

10 years ago

1.5.3

10 years ago

1.5.2

10 years ago

1.5.1

10 years ago

1.5.0

10 years ago

1.4.7

10 years ago

1.4.6

10 years ago

1.4.5

10 years ago

1.4.4

10 years ago

1.4.3

10 years ago

1.4.2

10 years ago

1.4.1

10 years ago

1.4.0

10 years ago

1.3.2

10 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

0.1.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago