How do I specify a wildcard string for the end/trailing of a folder

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