NPM便利サブコマンド

  • npm list --depth=10 好きなレベルを指定できる。--all ですべてのレベル。
  • npm list に深い階層にあるパッケージも指定できる。依存性を上にたどるような表示
  • npm view パッケージ (npm show パッケージ でも同じ)
  • npm view パッケージ dependencies
  • npm view パッケージ dist
  • npm explain パッケージ (npm why パッケージ でも同じ)

実例:

> npm view vue-docgen-api dist-tags
{
  latest: '4.54.2',
  globals: '2.0.10-globals-vue1',
  beta: '2.3.12-beta',
  next: '4.0.0-beta.17'
}

> npm view vue-docgen-api dependencies
{
  '@babel/parser': '^7.13.12',
  '@babel/types': '^7.18.8',
  '@vue/compiler-dom': '^3.2.0',
  '@vue/compiler-sfc': '^3.2.0',
  'ast-types': '0.14.2',
  'hash-sum': '^1.0.2',
  'lru-cache': '^4.1.5',
  pug: '^3.0.2',
  recast: '0.21.5',
  'ts-map': '^1.0.3',
  'vue-inbrowser-compiler-independent-utils': '^4.52.0'
}