Skip to content

Instantly share code, notes, and snippets.

@tech4him1
Last active September 21, 2017 01:21
Show Gist options
  • Save tech4him1/7fb18cd648e7e494ae15aa47a48738a0 to your computer and use it in GitHub Desktop.
Save tech4him1/7fb18cd648e7e494ae15aa47a48738a0 to your computer and use it in GitHub Desktop.
Check if a dependency is used in a project.
const grep = require('shelljs').grep;
const deps = require('./package.json').dependencies;
require('shelljs').cd(`${ __dirname }/src`);
for (let dep in deps) {
const finds = grep(dep, ['*.js', '**/*.js']);
console.log(`${ dep }: ${ finds.length }`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment