🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

npmfiles

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npmfiles - npm Package Compare versions

Comparing version
0.1.1
to
0.1.2
+9
-3
index.js

@@ -62,4 +62,7 @@ var fs = require('fs');

function getMainFiles(modulePath, override) {
var json = JSON.parse(fs.readFileSync(modulePath + '/package.json'));
var json;
var files = [];
try {
json = JSON.parse(fs.readFileSync(modulePath + '/package.json'));
} catch (e) { /* it's ok */ }

@@ -84,3 +87,3 @@ if(override.ignore){

//No main override
} else if(json.main){
} else if(json && json.main){
files = files.concat(

@@ -91,3 +94,6 @@ glob.sync(path.resolve(modulePath + "/" + json.main))

if (!files.length) {
console.warn('npmfiles: No main files found for module ' + path.relative(`${process.cwd()}/node_modules`, modulePath));
}
return files;
}
}
{
"name": "npmfiles",
"version": "0.1.1",
"version": "0.1.2",
"description": "Get all main files for your project's NPM modules",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet