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

include-all

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

include-all - npm Package Compare versions

Comparing version 0.0.6 to 0.1.0

15

index.js
var fs = require('fs');
var _ = {};
_.str = require('underscore.string');
var ltrim = require('underscore.string').ltrim;
// Returns false if the directory doesn't exist

@@ -38,3 +38,4 @@ module.exports = function requireAll(options) {

excludeDirs: options.excludeDirs,
startDirname: options.startDirname
startDirname: options.startDirname,
dontLoad: options.dontLoad
});

@@ -62,3 +63,3 @@

// make sure a slash exists on the left side of path
path = '/' + _.str.ltrim(path,'/');
path = '/' + ltrim(path,'/');

@@ -70,4 +71,4 @@ var pathMatch = path.match(options.pathFilter);

// Load module into memory
modules[identity] = require(filepath);
// Load module into memory (unless `dontLoad` is true)
modules[identity] = options.dontLoad ? true : require(filepath);
}

@@ -82,2 +83,2 @@ });

}
};
};
{
"name": "include-all",
"version": "0.0.6",
"version": "0.1.0",
"description": "An easy way to include all node.js modules within a directory. This is a fork of felixge's awesome module, require-all (https://github.com/felixge/node-require-all) which adds the ability to mark an include as **optional**.",

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

@@ -7,2 +7,3 @@ # include-all

- the ability to `include-all` a directory as **optional**.
- the ability to recursively stat a directory, instead of actually requiring the modules (via the `dontLoad` option)
- the ability to filter by path, not just filename (pathFilter)

@@ -9,0 +10,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