depstat
find all calls to require()
or import()
from the command line and tells how many times a module has been referenced in the js file(s)
Note:
this module is in very early development, please report any issues to github
searching for es6 modules will only work with jspm as the module loader
Install
$: npm install -g depstat
Usage
from your project's root folder:
$:~/Project$ depstat
depstat will assume the source directory is located at ./src
and package.json is located at .
:
but this can be changed with options:
$:~/Project$ depstat --path=[path to src files] --dep=[path to package.json]
example 1
with CommonJS loader
~/Project/package.json:
~/Project/src/foo.js:
const colors = ;const flatten = ;const minimatch = ;
then from the command line inside of your project's root folder:
$:~/Project$ depstat
depstat automatically searches through all js files in the ./src directory
the result:
times ref. dep name format___________________________________________________________________________1 colors CommonJS___________________________________________________________________________1 array-flatten CommonJS___________________________________________________________________________1 minimatch CommonJS
example 2
with es6 loader - jspm
~/Project/package.json:
"jspm": ,
~/Project/src/foo.js:
;;;
then from the command line:
$:~/www/client1/Project$ depstat --es6
depstat automatically searches through all js files in the ./src directory
the result:
times ref. dep name format___________________________________________________________________________1 colors es6___________________________________________________________________________1 array-flatten es6___________________________________________________________________________1 minimatch es6