license-checker
Advanced tools
Comparing version 0.0.10 to 0.1.0
@@ -9,3 +9,2 @@ | ||
var UNKNOWN = 'UNKNOWN'; | ||
var data = {}; | ||
var fs = require('fs'); | ||
@@ -17,3 +16,3 @@ var path = require('path'); | ||
var flatten = function(json) { | ||
var flatten = function(json, data) { | ||
var moduleInfo = {licenses: UNKNOWN}, | ||
@@ -81,5 +80,6 @@ licenseData, files, licenseFile; | ||
} | ||
flatten(childDependency); | ||
data = flatten(childDependency, data); | ||
}); | ||
} | ||
return data; | ||
}; | ||
@@ -90,10 +90,9 @@ | ||
console.log('scanning' , options.start); | ||
read(options.start, function(err, json) { | ||
flatten(json); | ||
var sorted = {}; | ||
read(options.start, { dev: true }, function(err, json) { | ||
var data = flatten(json, {}), | ||
sorted = {}; | ||
Object.keys(data).sort().forEach(function(item) { | ||
if (options.unknown) { | ||
if (data[item].licenses !== UNKNOWN) { | ||
if (data[item].licenses.indexOf('*') === -1) { | ||
if (data[item].licenses && data[item].licenses !== UNKNOWN) { | ||
if (data[item].licenses.indexOf('*') > -1) { | ||
delete data[item]; | ||
@@ -100,0 +99,0 @@ } |
@@ -5,8 +5,8 @@ { | ||
"author": "Dav Glass <davglass@gmail.com>", | ||
"version": "0.0.10", | ||
"version": "0.1.0", | ||
"dependencies": { | ||
"mkdirp": "^0.3.5", | ||
"treeify": "^1.0.1", | ||
"nopt": "^2.2.0", | ||
"read-installed": "^1.0.0" | ||
"read-installed": "~3.1.3", | ||
"treeify": "^1.0.1" | ||
}, | ||
@@ -13,0 +13,0 @@ "devDependencies": { |
@@ -49,3 +49,5 @@ var vows = require('vows'), | ||
'and give us results': function (d) { | ||
assert.equal(d['vows@0.7.0'].licenses, 'BSD*'); | ||
assert.ok(d); | ||
assert.ok(d['vows@0.8.0'], 'failed to lookup vows dep'); | ||
assert.equal(d['vows@0.8.0'].licenses, 'MIT'); | ||
assert.isTrue(Object.keys(d).length > 20); | ||
@@ -52,0 +54,0 @@ } |
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
15135
287
+ Addedasap@2.0.6(transitive)
+ Addeddebuglog@1.0.1(transitive)
+ Addeddezalgo@1.0.4(transitive)
+ Addedgraceful-fs@3.0.124.2.11(transitive)
+ Addednatives@1.1.6(transitive)
+ Addedread-installed@3.1.5(transitive)
+ Addedreaddir-scoped-modules@1.1.0(transitive)
+ Addedsemver@4.3.6(transitive)
+ Addedutil-extend@1.0.3(transitive)
- Removedgraceful-fs@2.0.3(transitive)
- Removedread-installed@1.0.1(transitive)
- Removedsemver@2.3.2(transitive)
Updatedread-installed@~3.1.3