1.0.3 • Published 8 years ago

js-code-stats v1.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

JS Code Stats

npm install -g js-code-stats # or --save

JS Code Stats search your codebase and notify you of,

  • Invalid imports
  • Unused files
  • Unused exports

CLI

js-code-stats ./src/**/*.js
File test/invalid-import/b.js attempted to import invalid imports: b
File test/invalid-import/a.js was never imported
File test/invalid-import/a.js defined unused exports: b
File test/invalid-import/b.js defined unused exports: default

You can specify to ignore unused exports exports from files using the ignore-unused-exports or -i option.

JS API

import jsCodeStats from 'js-code-stats';

jsCodeStats(files, {
  ignoreUnusedExports = [],
  parser = defaultParser,
  parserOptions = defaultParserOptions,
  resolveOptions = {},
}).then(({ unusedFiles, unusedExports, invalidImports }) => {
  ...
});

ignoreUnusedExports is the same as before.

Other options defined in get-es-imports-exports