3 ways to hide node_modules in vscode

3 ways to hide node_modules in vscode

In the short concise article, I will show you 3 ways to hide the node_modules directory in vscode (Visual Studio Code).

Method 1: Hide Node Modules vscode extension

Hide Node Modules is a great little vscode module created by Chris Bibby that does exactly what you want. The extension adds a right-click context menu action to show/hide the node_module folder in your javascript/nodejs projects.

  • In vscode click Extensions
  • Search for “Hide Node Modules
  • Choose the extension and click “Install
  • Back in file Explorer, right click and choose “Show/Hide Node Modules
video demonstrating the Show/Hide node_modules vscode extension.

Method 2: Hide node_modules in .vscode/settings.json

Time needed: 1 minute

  1. Create a folder in your project folder called .vscode

  2. Create a settings.json file inside .vscode, (i.e. .vscode/settings.json )

  3. Add the file.exclude setting with “**/node_modules” set to true

Method 3: Hide node_modules in .code-workspace file

This method is almost exactly like method 2 except we add the files.exclude setting in a vscode workspace file. This is the method used behind the scene by the Hide Node Modules extension.

# ./myproject.code-workspace
    "folders": [
            "path": "frontend"
    "settings": {
        "files.exclude": {

            "**/node_modules": true


One Reply to “3 ways to hide node_modules in vscode”

  1. Thank you for the good informations.
    At method 2 is’t : “files” not “file”.
    “files.exclude”: “**/node_modules”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Ads Blocker Image Powered by Code Help Pro

πŸ™πŸ™A Humble Request to Disable AdBlock πŸ™πŸ™

You can close this message & continue reading but...
❀️❀️❀️ Please consider visiting one of my sponsors first ❀️❀️❀️

DigitalOcean πŸš€

Sign up and get a $200, 60-day credit to try DO.
Spend $25 after your credit expires and I will also get $25 in credit!
DigitalOcean Referral Badge

Pictory πŸ€–

Create amazing videos using Pictorys AI powered software.
Its FREE to create your first 3 video projects

Hi Reader, I noticed that you are using an ad blocker while visiting my website. While I completely understand that excessive ads can hinder your browsing experience, ad revenue helps pay for the cost associated with operating this website.

jcutrer.com is a labor of love, created with the primary aim to provide you with quality content, free of cost. It’s a space where I share information, ideas, and insights that I hope have a meaningful impact. However, maintaining and updating this platform incurs substantial costs.