To only exclude files in e.g. node_modules but keep the folder, you could use the following: **/node_modules/*.
node_modules
**/node_modules/*