8
3

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 ls でイラッとしない

Posted at

みなさんは npm ls で依存モジュールがずらずらと表示されて、イラッとしたことはありませんか。私はあります。

npm ls --depth=0

とすれば、トップレベルのモジュールのみに制限できますが、いちいち --depth=0 をつけるのは面倒です。

そこで、次のコマンドを実行してみましょう。

npm config set depth 0

これ以降、--depth=0 をつけなくても、npm ls でトップレベルのモジュールのみが表示されるようになります。設定は ~/.npmrc に保存されます。

依存ツリーが見たい場合は、

npm ls --depth=9999

のように、depth を適当に大きな値で上書きすれば OK です。

参考

8
3
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
8
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?