Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

npm-profiler

abhishekayu6MIT2.0.0

A Comprehensive Analysis Command-Line Analysis Tool for Projects.

npm-profiler, npm profiler, npm, profiler, analysis, tool, command-line, project, comprehensive, analysis, tool, code, metrics, api, analysis, unused, profiler, project analysis, development insights, code efficiency, performance profiling, comprehensive analysis, total lines of code, total react components, project metrics, project profiler, npm Profiler, Command-Line Analysis Tool, Code Metrics, API Analysis, Unused Code Detection, Size Calculation, Node.js Project Analysis, Development Insights, Code Efficiency, Performance Profiling, Comprehensive Analysis, Total Lines of Code, Total React Components, Total React Routers, Total Configuration Files, Total Commented Lines, Total Active console.log Statements, Total Uncalled Functions, Total Unused Packages, Disk Space Consumption, Folder Sizes, Directory Analysis, JavaScript Files, File Analysis, Fetch and Axios Calls, Analysis Command, Project Metrics, Codebase Optimization, Dependency Tracking, Command-Line Interface (CLI), Static Code Analysis, Codebase Health, API Usage Insights, Codebase Cleanup, File Structure Analysis, Performance Optimization, Project Efficiency, Dependency Management, Project Maintenance, Development Productivity, Project Structure Evaluation, Codebase Examination, Functionality Assessment, Project Organization Analysis, JavaScript Code Insights, Development Workflow Enhancement, Package Dependency Insights, File Size Analysis, Codebase Refactoring, Project Documentation Generation

readme

NPM Profiler ℹ

npm Profiler : A Comprehensive Analysis Command-Line Analysis Tool for Projects.

Installation 💻

Windows

npm install npm-profiler

Mac

npm install -g npm-profiler

Features 🚀

**1. Count Analysis**

Designed to analyze files within a directory and provide insights such as the total number of files, lines of code, React components, React routers, and configuration files.

┌───────────┬────────────┬────────────┐
│ Extension │ TotalFiles │ TotalLines │
├───────────┼────────────┼────────────┤
│ .js       │ 2          │ 11         │
├───────────┼────────────┼────────────┤
│ .jsx      │ 3          │ 152        │
└───────────┴────────────┴────────────┘

It can provide you with:

  • Total Lines of Code: 5087
  • Total React Components: 14
  • Total React Routers: 3
  • Total Configuration Files: 1
  • Total Commented Lines: 11

Usage

Replace [options] with any combination of the following options:

  • -g: Indicates that the analysis should include all files within the directory.
  • -n: Include the node_modules, Dist etc directory to the analysis.
  • -w: Include whitespace lines in the line count.
  • -d: Download the analysis results as a CSV file named Project-count.csv.
  • -c: Count the total number of commented lines.

Note: -g is mandatory rest optional.

ayu-count -g 

#

**2. API Analysis**

Designed to analyze API calls within files in a directory. It provides insights such as the total number of API calls, the number of GET and POST calls for both Fetch and Axios.

┌───────┬─────────────┬───────────┬────────────┐
│ API   │ Total Calls │ GET Calls │ POST Calls │
├───────┼─────────────┼───────────┼────────────┤
│ Fetch │ 5           │ 4         │ 1          │
├───────┼─────────────┼───────────┼────────────┤
│ Axios │ 4           │ 2         │ 2          │
└───────┴─────────────┴───────────┴────────────┘

Usage

Replace [options] with any combination of the following options:

  • -g: Indicates that the analysis should include all files within the directory.
  • -d: Download the analysis results as a CSV file named Api-calls.csv.

Note: -g is mandatory rest optional.

ayu-api -g

#

**3. Unused Analysis**

Designed to analyze JavaScript files in a directory and provide insights such as the number of active console.log statements, commented console.log statements, total console.log statements, uncalled functions, and unused packages.

┌──────────────────────────────┬────────────────────┐
│ Package                      │ Version            │
├──────────────────────────────┼────────────────────┤
│ framer-motion                │ ^11.0.24           │
├──────────────────────────────┼────────────────────┤
│ ora                          │ ^8.0.1             │
├──────────────────────────────┼────────────────────┤
│ react-beautiful-dnd          │ ^13.1.1            │
└──────────────────────────────┴────────────────────┘

It can provide you with:

  • Total Active console.log Statements: 15
  • Total Commented console.log Statements: 2
  • Total Console.log Statements: 17
  • Total Uncalled Functions: 3
  • Total Commented Lines: 11
  • Total Unused Packages: 3

Usage

Replace [options] with any combination of the following options:

  • -g: Indicates that the analysis should include all JavaScript files within the directory.
  • -d: Download the analysis results as a CSV file named Unused.csv.

Note: -g is mandatory rest optional.

ayu-free -g

**4. Console Analysis**

Designed to manipulations on JavaScript, TypeScript, JSX, and TSX files within a specified directory. It offers options to comment out, remove, or uncomment console.log statements in these files. It's designed to aid in code maintenance tasks, such as cleaning up debug statements before deployment or preparing code for production.

Usage

To use ayu-console, run the following command:

ayu-console [option]

options:

  • gc: Comment out all console.log statements.
  • gr: Remove all console.log statements.
  • gar: Remove all active console.log statements.
  • gcr: Remove all inactive/commented console.log statements.
  • guc: Uncomment all console.log statements.
  • help: Display this help message.

Note Uncommented console.log statements will only work if they were commented out by this tool.

#

**5. Size Analysis**

Designed to calculate and display the sizes of directories and subdirectories within a specified root directory. It provides insights into the disk space consumption of various folders, excluding certain predefined folders like node_modules, dist etc.

┌────────────┬──────────┐
│ Folder     │ Size     │
├────────────┼──────────┤
│ public     │ 1.88 KB  │
├────────────┼──────────┤
│ src        │ 10.17 KB │
├────────────┼──────────┤
│ src\assets │ 4.03 KB  │
└────────────┴──────────┘

It can provide you with:

  • Total size of the (/) without folders: 329.31 KB
  • Size of 'dist': 147.38 KB
  • Size of 'node_modules': 64.14 MB

Usage

Replace [options] with any combination of the following options:

  • -g: Indicates that the analysis should include all directories and subdirectories within the root directory.
  • -d: Download the analysis results as a CSV file named Folder-sizes.csv.

Note: -g is mandatory rest optional.

ayu-size -g

Contributor

Abhishek Verma

Github email abhishekayu

Important: For any Queries, Suggestions, or Improvements

If you have any questions, feedback, or ideas for improvement, please don't hesitate to raise an issue or submit a pull request on GitHub. Your input is highly valued and helps to enhance this project for everyone. Thank you for your contribution!

Contribute

Contributions are always welcome! Please read the contribution guidelines first.

License

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