Last active
September 21, 2017 01:21
-
-
Save tech4him1/7fb18cd648e7e494ae15aa47a48738a0 to your computer and use it in GitHub Desktop.
Check if a dependency is used in a project.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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