Giter Club home page Giter Club logo

exportcounter's Introduction

JavaScript/TypeScript Export Counter

This is a utility script written in Node.js that counts the number of exports in JavaScript (.js) and TypeScript (.ts) files within a specified directory. The script traverses the directory recursively, looking into sub-directories as well.

Features

  • Count the number of exports in each .js or .ts file
  • Accepts a directory as a command line argument (defaults to the current working directory if not provided)
  • Outputs results in human readable, JSON, or CSV format
  • Option to sort results by the count of exports
  • Option to filter by file extension

Installation

Before running the script, ensure you have Node.js installed on your system. You can download Node.js from here.

Clone the repository:

git clone https://github.com/<your-username>/js-ts-export-counter.git

Navigate to the project directory:

cd js-ts-export-counter

Install the required Node.js modules:

npm install

Usage

Run the script with Node.js:

node index.js ./path/to/directory --format csv --sort --extension js,ts

Command line options:

  • --format, -f: Specify the output format. Options: human, csv, json. Default: human.
  • --sort, -s: Sort results by the count of exports. Default: false.
  • --extension, -e: File extension to filter by. Provide a comma-separated list for multiple extensions. Default: js,ts.

exportcounter's People

Contributors

scottarver avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.