Skip to content

Instantly share code, notes, and snippets.

@martinbuberl
Created March 27, 2025 10:33
Show Gist options
  • Save martinbuberl/1a10cfc69c7ca883a3deccfc1d9d8315 to your computer and use it in GitHub Desktop.
Save martinbuberl/1a10cfc69c7ca883a3deccfc1d9d8315 to your computer and use it in GitHub Desktop.
cloc Cheatsheet

cloc Cheatsheet

Next.js

cloc command to count the lines of code in a typical Next.js project while ignoring node_modules, .next, and other generated or irrelevant files would be:

cloc . --exclude-dir=.git,.next,.vercel,.turbo,.vscode,build,dist,out,node_modules --include-ext=js,jsx,ts,tsx,css,scss,html,json,md

Breakdown:

  • . → Run cloc in the current directory.
  • --exclude-dir=.git,.next,.vercel,.turbo,.vscode,build,dist,out,node_modules → Exclude commonly ignored/generated folders.
  • --include-ext=js,jsx,ts,tsx,css,scss,html,json,md → Only count relevant source files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment