Getting Started

CodeTracker is a powerful library that helps you keep track of the lines of code across different files. Whether you're a single developer or part of a large team, CodeTracker provides a flexible way to monitor your codebase.

Installation

First, install CodeTracker via npm:

npm install code-tracker

Basic Usage

Here's a simple example to help you get started:

Importing the Library

import { CodeTracker } from 'code-tracker';

Creating an Instance

Create a new instance of the CodeTracker class:

const codeTracker = new CodeTracker();

Tracking a File

Track a file with the specified number of lines of code:

codeTracker.trackFile('myFile.js');

Updating a File

Update the lines of code in an already tracked file:

codeTracker.updateFile('myFile.js');

Removing a File

Remove a file from being tracked:

codeTracker.removeFile('myFile.js');

Advanced Usage

CodeTracker supports a variety of advanced features, including:

  • Custom Tracking and Storage Strategies: Implement your own tracking and storage strategies.
  • Callbacks: Define custom callback functions for various events.
  • Utility Functions: Use additional methods like getFiles, getAverageLinesOfCode, filterFiles, and more.

For detailed information on these features, please refer to the API documentation.