snyk / nodejs-lockfile-parser

Generate a Snyk dependency tree from package-lock.json or yarn.lock file
Other
59 stars 28 forks source link

Provide usage examples #161

Closed skitterm closed 4 months ago

skitterm commented 2 years ago

Hi there, thanks for providing this package which makes it much easier to read the various lockfile formats.

From the README I was unsure how to use this package (do I npm-install it?), and what functions I could call once it's imported. From a look in /lib/index.ts I assume I'm looking for buildDepTreeFromFiles.

It would also be helpful to have each exposed function and its parameters (does manifest mean like the package.json file?) and return types documented, or at minimum a usage example of buildDepTreeFromFiles on the README. I think I've got it figured out now, but it'd be much smoother with some docs up-front. Thanks!