0.1.7 • Published 2 years ago

rate-usages v0.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

npm version

Find most used functions in your code

This utility takes glob as input (currently glob should end with ".js" extension), goes through all the files and count how many times each function is used. If your project have low test coverage, it can be useful to find out, what parts of the code are used most and should be covered first.

Usage

npx rate-usages glob (npx rate-usages ./my-code-here/*/.js -- please use forward shashes) OR import rateUsages from "rate-usages"; || const rateUsages = require("rate-usages").default;

const result = await rateUsages(glob, {...options})

Options

--min-usages | -m (number): don't show functions with usage count <= passed value. Default: 1. --ignore-test-files (boolean): Don't count function invocations in .test.js files. Default: false.

Example output

{ 'a' => { count: 2, path: Set(1) { './my-code-here/a.js' } }, 'b' => { count: 1, path: Set(1) { './my-code-here/b.js' } }, }

Any issues and PRs are welcome. This is extra alfa version, so if you find the idea useful and have any improvement in mind - go ahead and tell me.

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago