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

package-license

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

package-license - npm Package Compare versions

Comparing version 0.2.1 to 0.4.0

12

index.js

@@ -37,7 +37,15 @@ var fs = require('fs');

if (potentialFilenames[i].toLowerCase() === files[j].toLowerCase()) {
return licenseFromString(fs.readFileSync(path.resolve(packagePath, files[j]), 'utf8'));
var licenses = licenseFromString(fs.readFileSync(path.resolve(packagePath, files[j]), 'utf8'));
// if only one license is found remove array
if (_.isArray(licenses) && licenses.length === 1) licenses = licenses[0];
// remove duplicates
if (_.isArray(licenses) && licenses.length > 1) licenses = _.uniq(licenses);
return licenses;
}
}
}
return null;
return [];
}
{
"name": "package-license",
"version": "0.2.1",
"version": "0.4.0",
"description": "Checks the filesystem for potential license files and attempts to detect what they are",

@@ -19,6 +19,13 @@ "main": "index.js",

"author": "Duncan Wong <baduncaduncan@gmail.com>",
"contributors": [{
"name": "Alexander Wunschik",
"email": "dev@wunschik.net"
}],
"license": "Apache2",
"bugs": {
"url": "https://github.com/AceMetrix/package-license/issues"
},
"dependencies": {
"underscore": "~1.5.2"
}
}
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