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

npm-profiler

v2.0.0

Published

A Comprehensive Analysis Command-Line Analysis Tool for Projects.

Downloads

23

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

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