license-checker
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -10,2 +10,3 @@ /* | ||
json: require('path'), | ||
csv: require('path'), | ||
unknown: Boolean, | ||
@@ -22,4 +23,3 @@ version: Boolean, | ||
var raw = function (args) { | ||
var parsed = nopt(known, shorts, (args || process.argv)); | ||
return parsed; | ||
return nopt(known, shorts, (args || process.argv)); | ||
}; | ||
@@ -26,0 +26,0 @@ |
@@ -25,2 +25,3 @@ | ||
moduleInfo.repository = json.repository.url.replace('git://github.com', 'https://github.com').replace('.git', ''); | ||
moduleInfo.repository = json.repository.url.replace('git@github.com:', 'https://github.com/').replace('.git', ''); | ||
} | ||
@@ -81,3 +82,3 @@ } | ||
console.log('scanning', options.start); | ||
console.log('scanning' , options.start); | ||
@@ -106,1 +107,16 @@ read(options.start, function(err, json) { | ||
}; | ||
exports.asCSV = function(sorted) { | ||
var text = [['"module name"','"license"','"repository"'].join(',')]; | ||
Object.keys(sorted).forEach(function(key) { | ||
var module = sorted[key], | ||
line = [ | ||
'"' + key + '"', | ||
'"' + (module.licenses || '') + '"', | ||
'"' + (module.repository || '') + '"' | ||
].join(','); | ||
text.push(line); | ||
}); | ||
return text.join('\n'); | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"author": "Dav Glass <davglass@gmail.com>", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "mkdirp": "^0.3.5", |
@@ -60,2 +60,4 @@ NPM License Checker | ||
Added support for `--csv /path/to/save.csv` to export the data as comma-separated values. | ||
Requiring | ||
@@ -62,0 +64,0 @@ --------- |
@@ -30,4 +30,9 @@ var vows = require('vows'), | ||
assert.isTrue(Object.keys(d).length > 70); | ||
assert.equal(d['abbrev@1.0.4'].licenses, 'MIT'); | ||
assert.equal(d['abbrev@1.0.5'].licenses, 'MIT'); | ||
}, | ||
'and convert to CSV': function(d) { | ||
var str = checker.asCSV(d); | ||
assert.equal('"module name","license","repository"', str.split('\n')[0]); | ||
assert.equal('"abbrev@1.0.5","MIT","http://github.com/isaacs/abbrev-js"', str.split('\n')[1]); | ||
}, | ||
'should parse local without unknown': { | ||
@@ -34,0 +39,0 @@ topic: function () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15398
286
80