Skip to content

Instantly share code, notes, and snippets.

@bluzi
Created October 12, 2017 16:16
Show Gist options
  • Save bluzi/e4ac6a087b5d973f9a2572a536a2bb63 to your computer and use it in GitHub Desktop.
Save bluzi/e4ac6a087b5d973f9a2572a536a2bb63 to your computer and use it in GitHub Desktop.
Test file for licensewatch
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