-
-
Save dtex/70b21fd876a889d10156e9ff74430635 to your computer and use it in GitHub Desktop.
LicenseWatch-CLI With Blessed UI
This file contains hidden or 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
'use strict' | |
const LicenseWatch = require('licensewatch') | |
const blessed = require('blessed') | |
const blessedContrib = require('blessed-contrib') | |
const fs = require('fs') | |
const Barcli = require('barcli') | |
const licenses = new LicenseWatch(getModulesDirectory()) | |
licenses.fetch() | |
licenses.on('licensesSummary', (data) => { | |
for (let license in data.licenses) { | |
var graph = new Barcli({ | |
label: license, | |
range: [0, data.maxLicense.count], | |
}); | |
graph.update(data.licenses[license]) | |
} | |
}) | |
function getModulesDirectory() { | |
return process.cwd() + '/node_modules/**/package.json' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment