Created
October 12, 2017 16:16
-
-
Save bluzi/e4ac6a087b5d973f9a2572a536a2bb63 to your computer and use it in GitHub Desktop.
Test file for licensewatch
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 LicenseWatch = require('./dist/index.js') | |
const licenses = new LicenseWatch('node_modules/**/package.json') | |
licenses.fetch() | |
var licensesCount = 0 | |
licenses.on('files', (files) => { | |
console.log('files processed' + ' - ' + files.length + ' - ' + files[0]) | |
}) | |
licenses.on('license', () => { | |
licensesCount++ | |
}) | |
licenses.on('licenses', (licenses) => { | |
console.log(licenses.length) | |
}) | |
licenses.on('licensesSummary', (licenses) => { | |
console.log(licenses) | |
}) | |
licenses.on('error', (error) => { | |
console.log('errors mate, from down under') | |
console.log(error) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment