synp
synp copied to clipboard
Use npm-logical-tree to get a traversable dependency graph
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
Why cannot we just use JSON.parse(), to parse the strings?
How do you mean @redoz94 ?
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.
As an alternative: https://github.com/npm/arborist
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).