2.0.0 ā€¢ Published 5 days ago

npm-profiler v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

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

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