Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use npm-logical-tree to get a traversable dependency graph #5

Open
imsnif opened this issue Nov 20, 2017 · 5 comments
Open

Use npm-logical-tree to get a traversable dependency graph #5

imsnif opened this issue Nov 20, 2017 · 5 comments

Comments

@imsnif
Copy link
Owner

imsnif commented Nov 20, 2017

Right now, we're doing a lot of this manually, and flattening the package-lock.json file. It'll save a lot (and likely protect against future breakage) to use this instead:

https://www.npmjs.com/package/npm-logical-tree

@redoz94
Copy link

redoz94 commented Nov 6, 2019

Why cannot we just use JSON.parse(), to parse the strings?

@imsnif
Copy link
Owner Author

imsnif commented Nov 6, 2019

How do you mean @redoz94 ?

@imsnif
Copy link
Owner Author

imsnif commented Nov 6, 2019

Ah, I think this is due to bad wording on my part in the issue name - sorry! npm-logical-tree is pretty neat in that it would allow us to get a traversable tree representation of a package.json + package-lock.json combination. We could use that to figure out all the dependencies and make a yarn.lock file (or do the reverse with some adjustments). It's far simpler than what this package does at the moment.

@imsnif imsnif changed the title Use npm-logical-tree for parsing package-lock.json Use npm-logical-tree to get a traversable dependency graph Nov 6, 2019
@antongolub
Copy link
Collaborator

As an alternative: https://github.com/npm/arborist

@imsnif
Copy link
Owner Author

imsnif commented Aug 31, 2020

For sure :)
Though to note: if we use npm-logical-tree, we'll probably be able to forgo having a node_modules on disk. In that case, we might even be able to run in the browser (unless I'm missing something).

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

No branches or pull requests

3 participants