Skip to content

Instantly share code, notes, and snippets.

@prochafilho
Created March 16, 2018 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prochafilho/1ee3e6eaaa78836c8a7bc05eb9359195 to your computer and use it in GitHub Desktop.
Save prochafilho/1ee3e6eaaa78836c8a7bc05eb9359195 to your computer and use it in GitHub Desktop.
Checks for modules using GPL License
const path = require('path')
const checker = require('license-checker')
function usingGPL(err, packages){
if (err) {
throw err
} else {
let gpls = Object
.keys(packages)
.filter(package =>
packages[package]
.licenses
.includes('GPL'))
console.log(gpls)
}
}
checker
.init({start: path.resolve(__dirname)}, usingGPL);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment