npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

codebase-tracker

v1.0.3

Published

A tool to track React/Next.js component usage and Node.js function usage across a full codebase.

Downloads

32

Readme

Codebase Tracker

A CLI tool to track the usage of React/Next.js components and Node.js functions across an entire codebase. This package provides insights into function definitions, imports, and calls, allowing developers to analyze their codebase efficiently.

Just install it globally and use a simple command to generate report

1. install globally

npm i -g codebase-tracker

2. Generate Report

npx codebase-tracker --directory ./ --output component-function-usage-report.txt

3. Access the reoprt in your project directory

Features

  • Comprehensive Tracking: Analyze all JavaScript files in the specified directory to track function usage.
  • Detailed Reports: Generate reports that include:
    • Each function's definition location.
    • All import statements.
    • Call locations with total counts and line numbers.
  • Project Structure Representation: Display the project directory tree along with function usage statistics.

Installation

To use codebase-tracker, you can install it globally using npm:

npm install -g codebase-tracker

Or clone the repository and link it locally:

git clone https://github.com/Kanai2003/codebase-tracker.git
cd codebase-tracker
npm link

Usage

Run the CLI command in your terminal:

npx codebase-tracker --directory <path_to_your_codebase> --output <output_file_name>

Example

npx codebase-tracker --directory ./ --output component-function-usage-report.txt

Sample Output


===== Component and Function Usage Report =====

Generated by: codebase-tracker
Project: youtube_clone

Total Files: 35
Total Directories: 7
Total Lines of Code: 2472

--- Project Dependencies ---

bcrypt: ^5.1.1
cloudinary: ^1.41.1
cookie-parser: ^1.4.6
cors: ^2.8.5
dotenv: ^16.3.1
express: ^4.18.2
jsonwebtoken: ^9.0.2
mongoose: ^8.0.3
mongoose-aggregate-paginate-v2: ^1.0.6
multer: ^1.4.5-lts.1

==============================================

--- Project File Structure ---

└── src/
    └── index.js (26 LOC)
    └── constants.js (1 LOC)
    └── app.js (44 LOC)
    └── utils/
        └── cloudinary.js (30 LOC)
        └── asyncHandler.js (30 LOC)
        ...more
    └── routes/
        └── video.routes.js (57 LOC)
        └── user.routes.js (77 LOC)
            ...more
    └── models/
        └── video.model.js (45 LOC)
        ...more
    └── middlewares/
        └── multer.middleware.js (16 LOC)
        └── auth.middleware.js (27 LOC)
    └── db/
        └── index.js (15 LOC)
    └── controllers/
        └── video.controller.js (240 LOC)
        ...more


==============================================

Backend/Frontend Functions Usage:

Function: app
  - Imported at: src/index.js, Line: 3
  - Called at: src/app.js, Total Calls: 30, Line: 8

Function: connectDB
  - Called at: src/index.js, Total Calls: 1, Line: 12
  - Defined at: src/db/index.js, Line: 5

Function: uploadOnCloudinary
  - Defined at: src/utils/cloudinary.js, Line: 13
  - Imported at: src/controllers/video.controller.js, Line: 6
  - Imported at: src/controllers/user.controller.js, Line: 4

  ----------------------Many more-------------------------

Contributing

Contributions are welcome! If you have suggestions or improvements, feel free to create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Kanailal Manna

github: https://github.com/kanai2003

repo: https://github.com/Kanai2003/codebase-tracker