Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Codeline CounterNew to Visual Studio Code? Get it now.
Codeline Counter

Codeline Counter

Pyzit Inc

|
12 installs
| (1) | Free
Counts lines of code in files or workspace.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

📊 Codeline Counter

Easily count the lines of code in your files or entire workspace. Supports excluding folders or specific files via .codelineignore.

🚀 Features

  • 🔢 Count total lines in open file or entire workspace
  • 📁 Exclude folders or files using .codelineignore
  • ⚙️ Lightweight and fast

Codeline Counter Demo


📦 Installation

Search for Codeline Counter in the Extensions Marketplace and click Install.

Or install via command line:

code --install-extension Pyzit.codeline-counter

🔧 Usage

1. Count Lines of Code in an Open File

To count the lines of code in the currently open file:

  1. Open any file in VS Code.

  2. Press Ctrl + Shift + P (or Cmd + Shift + P on macOS) to open the Command Palette.

  3. Search for the command:

  4. Select the Count Lines of Code command from the list.

  5. The total number of lines in the file will be shown in the status bar at the bottom of your VS Code window.


2. Count Lines of Code in an Entire Workspace

To count the lines of code across your entire project or workspace:

  1. Open the workspace/folder where your project resides in VS Code.
  2. Press Ctrl + Shift + P (or Cmd + Shift + P on macOS) to open the Command Palette.
  3. Search for the command:
  4. Select the Count Lines of Code (Workspace) command from the list.
  5. The total number of lines in the entire workspace will be displayed in the status bar.

3. Exclude Files or Folders with .codelineignore

To exclude certain files or folders from being counted (such as node_modules, dist, or temporary files), create a .codelineignore file in your project’s root directory and list the files/folders you want to ignore.

Example .codelineignore:

  • node_modules/: Exclude all files in the node_modules folder
  • dist/: Exclude all files in the dist folder
  • *.min.js: Exclude all minified JavaScript files

Any files or folders listed in this .codelineignore file will not be counted when calculating lines of code in the workspace.


4. View Results

After running the Count Lines of Code command, the results will be shown in the status bar at the bottom of the window.

Example output in the status bar:

This indicates the total number of lines in the current file or workspace, with the excluded lines subtracted (from ignored files or folders).


5. Additional Commands

  • Set Excluded Folders/Files: You can open the .codelineignore file using the Set Excluded Folders/Files command from the Command Palette and quickly add paths that should be excluded from the line count.

Example Use Case

Scenario 1: Counting Lines in a JavaScript Project

  1. Open the root folder of your JavaScript project in VS Code.
  2. Use the Count Lines of Code (Workspace) command to count lines across the entire project.
  3. The result will exclude any files or folders you’ve specified in .codelineignore (e.g., node_modules and dist).
  4. The total count will appear in the status bar.

Scenario 2: Counting Lines in a Single File

  1. Open a single file, for example, index.js.
  2. Use the Count Lines of Code command to get the number of lines in that file.
  3. The result will be shown in the status bar, providing a quick overview of the file's size.

🎯 Why Use This Extension?

  • For Developers: Easily track the size of your codebase.
  • For Project Managers: Get quick insights into the scope of a project.
  • For Continuous Integration: Integrate this tool into your build pipelines to analyze code growth over time.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft