This repository was archived by the owner on Feb 15, 2022. It is now read-only.
Description Not sure why, but to me it seems like the depth option isn't working at all:
$ npm init
$ npm i -D read-installed
$ npm i react
// index.js
const readInstalled = require("read-installed");
let depth = 0;
const log = (pkg) => {
console.log("-".repeat(depth) + " " + pkg.name + "@" + pkg.version);
depth += 1;
Object.keys(pkg.dependencies).forEach((name) => {
log(pkg.dependencies[name]);
});
depth -= 1;
};
readInstalled(".", { depth: 0 }, (err, data) => log(data));
Yields the following result:
$ node index.js
root@1.0.0
- react@16.8.4
-- loose-envify@1.4.0
--- js-tokens@4.0.0
-- object-assign@4.1.1
-- prop-types@15.7.2
--- loose-envify@1.4.0
---- js-tokens@4.0.0
--- object-assign@4.1.1
--- react-is@16.8.4
-- scheduler@0.13.4
--- loose-envify@1.4.0
---- js-tokens@4.0.0
// ... etc
Instead of what I would expect:
$ node index.js
root@1.0.0
- react@16.8.4
Without and transient dependencies ... ?
Reactions are currently unavailable
Not sure why, but to me it seems like the
depthoption isn't working at all:Yields the following result:
Instead of what I would expect:
Without and transient dependencies ... ?