Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

license-checker

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

license-checker - npm Package Compare versions

Comparing version 0.0.10 to 0.1.0

17

lib/index.js

@@ -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 @@ }

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc