read-installed
Read all the installed packages in a folder, and return a tree structure with all the data.
read-installed
This tool does one thing: it scans a folder on your computer, finds all the npm packages (libraries) that have been installed there, and organizes the information about them into a tree structure. Instead of just giving you a flat list, it shows you how packages relate to each other — which packages depend on which other packages.
The main reason you'd use this is if you're building a tool that needs to understand what's installed in a JavaScript project. The npm package manager itself uses this library to figure out what's available. For example, if you're creating a development tool that needs to analyze a project's dependencies, audit what's installed, or build a visualization of how packages connect, this does the heavy lifting of collecting and organizing that data for you.
When you use it, you point it at a folder (usually a project directory) and it walks through everything installed there. You can customize how it behaves with options: you can limit how deep it looks into nested dependencies, add logging to see what it's doing, or tell it whether to include development dependencies or just the ones needed to run the code. It returns all this information organized in a tree, making it easy to see the hierarchy.
The tool was recently updated to version 2.0.0 with some changes to how you pass options to it — instead of multiple arguments, you now pass a single options object with the settings you want. This is a common pattern in JavaScript libraries and makes the code cleaner and more flexible as features are added over time.