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

nlf

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nlf - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

coverage.html

46

lib/nlf.js

@@ -16,5 +16,10 @@ /**

path = require('path'),
fs = require('fs'),
glob = require('glob'),
FileSource = require('./file-source'),
PackageSource = require('./package-source'),
csvFormatter = require('./formatters/csv'),
standardFormatter = require('./formatters/standard'),
LicenseCollection = require('./license-collection'),
licenseFind = require('./license-find'),
matchNodeModules = /node_modules\//;

@@ -249,2 +254,3 @@

addFiles(readmeFiles, module.licenseSources.readme, function (err) {
var index;

@@ -256,2 +262,3 @@ if (err) {

// finally, if there is data in package.json relating to licenses
// simple license declarations first
if (moduleData.license) {

@@ -261,2 +268,11 @@ module.licenseSources.package.add(new PackageSource(moduleData.license));

// more complex ones
if (moduleData.licenses) {
for (index = 0; index < moduleData.licenses.length; index++) {
module.licenseSources.package.add(
new PackageSource(moduleData.licenses[index])
);
}
}
callback(null, module);

@@ -317,3 +333,23 @@ });

/**
* Does a file exist?
*
* @param {String} filePath The path of the file
* @return {Boolean} True if the file exists
*/
function fileExistsSync(filePath) {
try {
var stats = fs.statSync(filePath);
return stats.isFile();
} catch (err) {
if (err.code === 'ENOENT') {
return false;
}
throw err;
}
}
/**
* Function to find licenses

@@ -342,2 +378,6 @@ *

if (!fileExistsSync(path.join(options.directory, 'package.json'))) {
return callback(new Error('No package.json file found.'));
}
// use npm read-installed module to search out all the node modules

@@ -368,3 +408,7 @@ readInstalled(options.directory, null, log, function (err, data) {

'FileSource': FileSource,
'PackageSource': PackageSource
'PackageSource': PackageSource,
'csvFormatter': csvFormatter,
'standardFormatter': standardFormatter,
'licenseFind': licenseFind,
'LicenseCollection': LicenseCollection
};

14

package.json

@@ -6,3 +6,3 @@ {

"author": "Ian Kelly <iandotkelly@gmail.com>",
"version": "0.2.3",
"version": "0.2.4",
"license": "MIT",

@@ -18,12 +18,12 @@ "bin" : {

"dependencies": {
"commander": "~0.6.1",
"read-installed": "~0.2.2",
"glob": "~3.2.1",
"commander": "~2.0.0",
"read-installed": "~0.2.4",
"glob": "~3.2.6",
"archy": "~0.0.2"
},
"devDependencies": {
"jshint": "~2.1.4",
"jshint": "~2.1.10",
"should": "~1.2.2",
"mocha": "~1.12.0",
"globs": "~0.1.0"
"mocha": "~1.12.1",
"globs": "~0.1.1"
},

@@ -30,0 +30,0 @@ "engines": {

<!-- @@NLF-IGNORE@@ -->
# Node License Finder (nlf)
# Node License Finder (nlf) [![Build Status](https://secure.travis-ci.org/iandotkelly/nlf.png)](http://travis-ci.org/iandotkelly/nlf) [![Dependency Status](https://gemnasium.com/iandotkelly/nlf.png)](https://gemnasium.com/iandotkelly/nlf)

@@ -5,0 +5,0 @@ nlf is a utility for attempting to identify the licenses of modules in a node.js project.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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