Simple tool to measure module cohesion size based on the imports path.
- Check all dependencies
- Count distance from current module
- Every level of distance adds 1 point
- Add points for every dependency
- Sum all points
`./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
$ npx measure-modules ./bin/measure-modules.js
Total score: 3
--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