measure-modules

1.1.0 • Public • Published

Measure modules

Simple tool to measure module cohesion size based on the imports path.

Score algorithm

  1. Check all dependencies
  2. Count distance from current module
  3. Every level of distance adds 1 point
  4. Add points for every dependency
  5. Sum all points

Example

`./src/foo/bar/baz.js` depends on `./src/foo/test.js` and `./src/something/also.js`
And it scores 6 points:
../../something/also.js 4
../test.js 2

Usage

$ npx measure-modules ./bin/measure-modules.js
Total score: 3

Options:

  --requireConfig  RequireJS config for resolving aliased modules
  --webpackConfig  Webpack config for resolving aliased modules
  --tsConfig       TypeScript config for resolving aliased modules - Either a path to a tsconfig file or an object containing the config

Readme

Keywords

none

Package Sidebar

Install

npm i measure-modules

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

9.03 kB

Total Files

10

Last publish

Collaborators

  • bondian0