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 2.0.2 to 3.0.0

26

lib/index.js

@@ -67,16 +67,20 @@

moduleInfo.licenses = license(json.readme);
} else {
files = fs.readdirSync(json.path).filter(function(filename) {
filename = filename.toUpperCase();
return filename.indexOf('LICENSE') > -1 || filename.indexOf('LICENCE') > -1 ;
});
}
files.forEach(function(filename) {
licenseFile = path.join(json.path, filename);
// Checking that the file is in fact a normal file and not a directory for example.
if (fs.lstatSync(licenseFile).isFile()) {
files = fs.readdirSync(json.path).filter(function(filename) {
filename = filename.toUpperCase();
return filename.indexOf('LICENSE') > -1 || filename.indexOf('LICENCE') > -1 ;
});
files.forEach(function(filename) {
licenseFile = path.join(json.path, filename);
// Checking that the file is in fact a normal file and not a directory for example.
if (fs.lstatSync(licenseFile).isFile()) {
if (moduleInfo.licenses.indexOf(UNKNOWN) > -1) {
//Only re-check the license if we didn't get it from elsewhere
moduleInfo.licenses = license(fs.readFileSync(licenseFile, {encoding: 'utf8'}));
}
});
}
moduleInfo.licenseFile = licenseFile;
}
});

@@ -83,0 +87,0 @@ if (Array.isArray(moduleInfo.licenses)) {

var MIT_LICENSE = /ermission is hereby granted, free of charge, to any/;
var BSD_LICENSE = /edistribution and use in source and binary forms, with or without/;
var BSD_LICENSE = /edistribution and use in source and binary forms, with or withou/;
var MIT = /MIT\b/;

@@ -4,0 +4,0 @@ var BSD = /BSD\b/;

@@ -5,3 +5,3 @@ {

"author": "Dav Glass <davglass@gmail.com>",
"version": "2.0.2",
"version": "3.0.0",
"dependencies": {

@@ -8,0 +8,0 @@ "chalk": "~0.5.1",

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