Skip to content

Instantly share code, notes, and snippets.

@martinbuberl
Created March 27, 2025 10:33
Show Gist options
  • Select an option

  • Save martinbuberl/1a10cfc69c7ca883a3deccfc1d9d8315 to your computer and use it in GitHub Desktop.

Select an option

Save martinbuberl/1a10cfc69c7ca883a3deccfc1d9d8315 to your computer and use it in GitHub Desktop.

Revisions

  1. martinbuberl created this gist Mar 27, 2025.
    14 changes: 14 additions & 0 deletions cloc-cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # cloc Cheatsheet

    ## Next.js

    [cloc](https://github.com/AlDanial/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.