Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Depth not working? #47

Open
flopes89 opened this issue Mar 7, 2019 · 2 comments
Open

Depth not working? #47

flopes89 opened this issue Mar 7, 2019 · 2 comments

Comments

@flopes89
Copy link

flopes89 commented Mar 7, 2019

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:

Instead of what I would expect:

Without and transient dependencies ... ?

  • node 8.9.0, npm 5.5.1
@sebastianhaas
Copy link

I am experiencing the same issue.

@sebastianhaas
Copy link

This entire program relies on the old, layered node_modules format. It seems it cannot deal with the current flat node_modules format.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants