0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

npm-check でpackageの更新情報と未使用を検出する

Posted at

npm-check package で依存 package の更新情報と未使用を検出します

インストール

$ npm install -g npm-check

サンプル

npm 版の cowsay に対して試してみます。

2件の更新対象がみつかりました。

$ pwd
<cowsay project root>
$ npm-check
get-stdin   😎  MAJOR UP  Major update available. https://github.com/sindresorhus/get-stdin
                         npm install --save get-stdin@5.0.1 to go from 4.0.1 to 5.0.1

nodeunit    😎  NEW VER!  NonSemver update available. https://github.com/caolan/nodeunit#readme
                         npm install --save-dev nodeunit@0.10.0 to go from 0.9.3 to 0.10.0

Use npm-check -u for interactive update.

npm-check.gif

まとめ

更新情報を検出するだけなら npm outdated と変わりませんが、
package.json にあるが未使用の Package や、逆にコード内で利用しているが
package.json に依存の記載がない Package も警告してくれます。
ただし精度に問題があるようです。

依存性のチェックは depcheck/depcheck package で行っていますが、
このリポジトリのREADMEでも以下のように明言しています。

The logic of a special is not perfect. There might be false alerts. If this happens, please open an issue for us.

とはいえ、有益であることに変わらないのでしょう。
npm-check の star が 2016/08/31 現在で 2,697 もついているので。

外部資料

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?