What Node.JS-specific files and folders are usually excluded via .gitignore?

Gitnode.js

Git Problem Overview


I'm a newbie Node.JS developer...

What do developers usually exclude from their Node.JS git repositories in production via .gitignore?

node_modules? bin? Etc...

Git Solutions


Solution 1 - Git

GitHub has created a repository to answer this kind of questions for several languages/frameworks, including one for NodeJS.

https://github.com/github/gitignore/blob/master/Node.gitignore

Here is the current one for reference :

lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results
build

node_modules

Solution 2 - Git

Solution 3 - Git

As a start:

.DS_Store
thumbs.db
*.log
node_modules/

Add your config.json, compiled .js if you're using coffeescript, etc.

Solution 4 - Git

> You can do it on the site gitignore.io.

gitignore.io is a web service designed to help you create .gitignore files for your Git repositories. The site has a graphical and command line method of creating a .gitignore for your operating system, programming language, or IDE.

> Link to .gitignore only for Node.js.

Video tutorial for the service.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAarononthewebView Question on Stackoverflow
Solution 1 - Gitseppo0010View Answer on Stackoverflow
Solution 2 - GitalessioalexView Answer on Stackoverflow
Solution 3 - GitRicardo TomasiView Answer on Stackoverflow
Solution 4 - GitVictor S.View Answer on Stackoverflow