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

analyze-codebase

v1.2.1

Published

Codebase Analyzer

Downloads

14

Readme

Codebase Analyzer

Codebase Analyzer is a command-line tool that analyzes a specified directory and provides summary information about the code files it contains. It can help you gain insights into your codebase's structure, naming conventions, and content types.

Example Image

Features

  • Analyzes the specified directory recursively
  • Provides summary information about file name cases and content types
  • Supports filtering by file extensions and excluding specific directories/files
  • Customizable through command-line options

Installation

You can install Codebase Analyzer globally using NPM:

npm install -g analyze-codebase 

or use with npx

npx analyze-codebase ./MyProject --exclude node_modules dist --extensions .tsx .ts

Usage

To analyze a directory, use the analyze command followed by the directory path. Here's an example:

analyze-codebase ./MyProject --exclude node_modules dist --extensions .tsx .ts

Options

  • -f, --framework : Specify the framework used in the codebase.

  • -e, --extensions <extensions...>: Specify the file extensions to include in the analysis. You can provide multiple extensions separated by spaces. Example: -e .js .ts.

  • -e, --exclude <exclude...>: Specify directories or files to exclude from the analysis. You can provide multiple paths separated by spaces. Example: -e node_modules dist.

  • --checkFileNames [checkFileNames]: Check file names. Default: true.

  • --checkFileContent [checkFileContent]: Check file content. Default: true.

  • -w or --writeJsonOutput [writeJsonOutput]: Write json putput for tracking. Default false

Black list

analyze-codebase by default have a black list of folder names which don't want to analyze which this directories mostly should be out of analyze (i.e. dist or static files)

  • node_modules
  • dist
  • build
  • coverage
  • public
  • test
  • tests
  • mocks

Examples

Analyze a directory with default options:

analyze-codebase ./src

Analyze a directory with a specified framework and file extensions:

analyze-codebase ./src -f react --extensions .js .jsx .ts .tsx

Exclude specific directories from the analysis:

analyze-codebase ./src --exclude node_modules dist

Analyze only file names

analyze-codebase ./src --exclude node_modules dist --checkFileContent=false

Analyze only file content

analyze-codebase ./src --exclude node_modules dist --checkFileNames=false

Write json output of this analyze

analyze-codebase -w

or

analyze-codebase --writeJsonOutput

Contribution

We welcome contributions to enhance the functionality and features of Codebase Analyzer. To contribute to the project, please follow these steps:

Fork the repository by clicking on the "Fork" button at the top right corner of this page.

Clone the forked repository to your local machine:

git clone https://github.com/your-username/analyze-codebase.git

Create a new branch for your feature or bug fix:

git checkout -b feature/your-feature-name

or

git checkout -b bugfix/your-bug-fix

Make your modifications and additions to the codebase.

Test your changes thoroughly to ensure they do not introduce any issues.

Commit your changes with a descriptive commit message:

git commit -m "Add your commit message here"

Push your changes to your forked repository:

git push origin feature/your-feature-name

or

git push origin bugfix/your-bug-fix

Open a pull request (PR) from your forked repository to the original repository. Provide a clear and concise description of your changes in the PR.

Wait for the maintainers to review your PR. They may provide feedback or request additional changes.

Once your PR is approved, it will be merged into the main branch, and your contributions will become a part of the Codebase Analyzer project.

Please ensure that you adhere to our code of conduct and follow the guidelines provided in the CONTRIBUTING.md file for a smooth and collaborative contribution process.

Thank you for your interest in improving Codebase Analyzer! Your contributions are highly appreciated.

License

This project is licensed under the MIT License.