← Developer Tools
🚫

Node.js .gitignore Generator — node_modules, dist, .env

Generate .gitignore files for any stack — instantly, offline, free

💡

Generate a complete .gitignore for Node.js projects. Covers node_modules, dist, build, coverage, debug logs, .env files, yarn/npm/pnpm lock issues, and all common Node tooling.

⚡ Quick Start:
STACKS8 selected
🔍
Selected stacks:
🪟 Windows 🍎 macOS 💙 VS Code 💚 Node.js ⚛️ React 🔐 .env Files 📋 Log Files 🔑 Secrets
GROUP BY CATEGORY
FORMAT
OUTPUT · .gitignore
# ============================================================
# Generated: CalcNation .gitignore Generator · 2026-03-14
# Stacks   : Windows, macOS, VS Code, Node.js, React, .env Files, Log Files, Secrets
# Format   : .gitignore
# ============================================================

# ────────────────────────────────────────────────────────────
# OS
# ────────────────────────────────────────────────────────────

# 🪟 Windows
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp
*.lnk

# 🍎 macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*
.fseventsd

# ────────────────────────────────────────────────────────────
# IDE
# ────────────────────────────────────────────────────────────

# 💙 VS Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
.history/

# ────────────────────────────────────────────────────────────
# LANGUAGE
# ────────────────────────────────────────────────────────────

# 💚 Node.js
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnp.cjs
.pnp.loader.mjs
.yarn/cache
dist/
build/
coverage/

# ────────────────────────────────────────────────────────────
# FRAMEWORK
# ────────────────────────────────────────────────────────────

# ⚛️ React
# React build output
build/
.env.local
.env.development.local
.env.test.local
.env.production.local

# ────────────────────────────────────────────────────────────
# TOOLS
# ────────────────────────────────────────────────────────────

# 🔐 .env Files
.env
.env.local
.env.*.local
.env.development
.env.test
.env.production
!.env.example
!.env.sample

# 📋 Log Files
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

# 🔑 Secrets
# Security — never commit these
*.pem
*.key
*.p12
*.pfx
*.cer
*.crt
id_rsa
id_rsa.pub
*.secret
secrets.json
secrets.yaml
*.keystore

📄 110 lines·💾 3.1 KB·📦 8 stacks·🔧 .gitignore

Frequently Asked Questions

Should I ignore package-lock.json?

No — package-lock.json should be committed for applications. It locks dependency versions for reproducible installs. Only ignore it in published libraries (not applications).

Why ignore node_modules?

node_modules can contain thousands of files and hundreds of MBs. They are always reproducible via npm install and should never be in version control.

Should I ignore .env files?

Always ignore .env, .env.local, .env.*.local. Never commit real credentials. Always keep .env.example committed as a template showing which variables are needed.

What about TypeScript build output?

Add the TypeScript stack to also ignore *.tsbuildinfo, *.d.ts output, and dist/. The TypeScript stack entry handles all TS-specific build artifacts.

Can I add React or Next.js patterns?

Yes — select additional stacks like React or Next.js. The generator merges all patterns and deduplicates automatically.