The node_modules folder is often super big and contains countless files and subdirectories. Therefore, when using the tree command to display your project file structure, you should ignore node_modules. To do so, try this:
tree -I 'node_modules'
The result:
If you want the command to exclude more than one directory, you can use:
tree -I 'folder-1|folder-22|folder-3|folder-4'
Simple as that. Hope this short article can help you a little bit in some way.
Further reading:
- 4 Ways to Read JSON Files in Node.js
- Node.js: How to Ping a Remote Server/ Website
- Node.js: Getting User Input from Console (2 approaches)
- Node.js: How to Use “Import” and “Require” in the Same File
You can also check out our Node.js category page for the latest tutorials and examples.