This VSCode extension adds the ability to show and hide the node modules folder from within the explorer, via a context-menu, shortcut keys, command palette or status bar. The option to hide/show the node_modules folder is only available if a package.json or package-lock.json is detected within the current workspace folder.
Features
Show and hide the node_modules folder
Explorer context menu
Auto hide node_modules when opening a new folder
Status bar indicator when hiding a node_modules folder
How to use
Action
Windows / Linux
macOS
Command Palette
Show/Hide 'node_modules' folder
ctrl-alt-n
command-alt-n
Show/Hide Node Modules
How to manually unhide node_modules
If a folder/workspace is opened in VSCode without the Hide Node Modules extension but had previously used it to hide the node_modules folder, VSCode will keep it hidden - the extension uses an option within the VSCode settings.json file to control visibility of the node_modules folder.
To unhide the node_modules folder without using the extension:
Open the settings.json file located within the .vscode folder
Locate the line "**/node_modules": true within "files.exclude": { ... }
Change the value to "**/node_modules": false
Save the file
The node_modules folder should now be visible again within the explorer.