An open API service indexing awesome lists of open source software.

https://github.com/yiliansource/prsize

A CLI tool to measure JS/TS project sizes.
https://github.com/yiliansource/prsize

comments projects size

Last synced: about 1 year ago
JSON representation

A CLI tool to measure JS/TS project sizes.

Awesome Lists containing this project

README

          

# prsize

![npm](https://img.shields.io/npm/v/prsize)
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/yiliansource/prsize/tests/main)
![npm bundle size](https://img.shields.io/bundlephobia/min/prsize)
![npm](https://img.shields.io/npm/dt/prsize)
![supports](https://img.shields.io/badge/supports-.js%2C%20.ts-green)

---

This is a tool to quickly measure the size of your coding project, in terms of executable code, code-to-comment proportions and file size. Nothing that actually aids in development - just fun metrics here!

The tool currently supports `.js` and `.ts` files. More to come?

You can easily run the tool via `npx` (bundled with `npm` since 5.2):

```sh
npx prsize
```

Alternatively, you can globally install the tool into your commandline:

```sh
npm i -g prsize
prsize
```

The output will look something like this:

```
Hierarchy Size (in bytes) Executable lines Comment lines Total lines
----------------------------------------------------------------------------------------------------------------------
[<%>] [<%>] [<%>] [<%>]
... ... ... ... ...
```

## Usage

The default usage is to call the tool the following way:

```sh
npx prsize [path] [options]
```

`path` defaults to the current working directory (`.`), and you can use the [options](#options) below to customize the output.

## Options

| Name | Default Value | Description |
| :--------- | :------------ | :------------------------------------------------------------------------------------------------------------------------- |
| `--depth` | `-1` | How deep to show the tree. Note that regardless of this, the entire project will be scanned. `-1` to show the entire tree. |
| `--nodirs` | `false` | Whether to hide directory statistics. Note that the directories themselves will be shown regardless. |

## License

The project is licensed under a [MIT license](./license.md).