Skip to content

Instantly share code, notes, and snippets.

@buildAI
Last active February 22, 2019 12:28
Show Gist options
  • Save buildAI/fc630fa677ea73324556766cf4a26700 to your computer and use it in GitHub Desktop.
Save buildAI/fc630fa677ea73324556766cf4a26700 to your computer and use it in GitHub Desktop.
recursive_tree_parsing
  1. Write a function which takes an npm package name as input and returns dependencies and it's dependencies so on. Ex: If given a package a with dependencies x,y,z and x has dependency book. The function should return x,y,z,book.
  2. You have to call npm API to fetch the dependencies.
  3. Just get the dependencies don't worry about dev, peer dependencies
  4. Just get dependecies of latest version of the package don't worry about other versions.
  5. The final output should be an array of dependecies without duplicates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment