Wednesday, 3 May 2017

Dependency tree depth with npm ls

I wrote a tool that given a NodeJS project calculate its dependency tree in a format I need. It is based on npm ls command:

npm ls --parseable=true --long=true --production

I noticed that sometime this command reaches a maxdepth and a line like this is printed:

.../bn.js:bn.js@"^0.15.0"::MAXDEPTH

When MAXDEPTH appear the dependency tree reached its max. I have now few questions:

  1. What is the default max depth for npm ls (I didn't find this info in the doc)?
  2. With a limited MAXDEPTH, do I omit some dependencies?
  3. How can I have an infinite MAXDEPTH?
  4. Is it convenient have an infinite MAXDEPTH?

Thx



via Salvatore D'angelo

No comments:

Post a Comment