ESLintCC is a ECMAScript/JavaScript/TypeScript tool that computes complexity of code by using ESLint
ESLint calculates complexity of code, while this tool only collects a report based on his complexity rule messages
Requirements, principles of local and global installation and usage are the same as ESLint Installation and Usage
Globally:
$ npm install -g eslintcc
$ eslintcc yourfile.js
Locally:
$ npm install eslintcc
$ ./node_modules/.bin/eslintcc yourfile.js
NPX (you can do it without installing):
$ npx eslintcc yourfile.js
Integration in JavaScript application (see more...):
const { Complexity } = require('eslintcc');
const complexity = new Complexity();
const report = await complexity.lintFiles(['yourfile.js']);
console.log(JSON.stringify(report, null, '\t'));
Note: ESLintCC ignores all rules, specified in configuration files, and uses to generate a report only complexity rules.