Created
April 4, 2014 21:17
-
-
Save bernieperez/9983330 to your computer and use it in GitHub Desktop.
Quick way to dump your transitive licenses from your node app.
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
'use strict'; | |
var checker = require('license-checker'); | |
// Example of how to use: | |
// cd to the node app directory | |
// node license.js ./ > ~/Desktop/app-name.csv | |
console.log("Name@version, repo, licenses"); | |
checker.init({ | |
start: process.argv[2] | |
}, function(json) { | |
for (var key in json) { | |
if (json.hasOwnProperty(key)) { | |
console.log(key + "," + json[key].repository + "," + json[key].licenses); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't forget it needs https://www.npmjs.org/package/license-checker