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

include-all

Package Overview
Dependencies
Maintainers
3
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 1.0.4 to 1.0.5

58

index.js

@@ -32,3 +32,3 @@ /**

//////////////////////////////////////////////////////////////////////////////
// The rest of the methods below are all originally from sails-build-dictionary.
// The four methods below are all originally from sails-build-dictionary.
// They are asynchronous, and besides defaulting certain options, they do a

@@ -46,2 +46,3 @@ // handful of extra things. So it's more than just options getting defaulted!

*
* @async
* @param {Dictionary} options

@@ -61,2 +62,3 @@ * @param {Function} cb

*
* @async
* @param {Dictionary} options

@@ -77,2 +79,3 @@ * @param {Function} cb

*
* @async
* @param {Dictionary} options

@@ -94,2 +97,3 @@ * @param {Function} cb

*
* @async
* @param {Dictionary} options

@@ -104,1 +108,53 @@ * @param {Function} cb

};
//////////////////////////////////////////////////////////////////////////////
// Finally, this last method is sort of like a recursive `ls`.
// Similarly, it's more or less just a synchronous version of `.exists()`,
// but with a few more specific hard-coded overrides.
//////////////////////////////////////////////////////////////////////////////
/**
* Build a flat dictionary of the matched modules, where the keys are the
* paths, and the values are `true` (fails silently-- returns {} if the
* container cannot be loaded)
*
* @param {Dictionary} options
* @returns {Dictionary}
*/
module.exports.scanSync = function(options) {
// Higher level overrides.
options.flatten = true;
options.keepDirectoryPath = true;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Note: the combination of the following overrides make this
// more or less equivalent to `.exists()`-- but synchronous.
// Not all options work... instead, this is really designed
// for a slightly different kind of use case-- where you want
// to recursively, synchronously stat modules, rather than
// include them.
options.optional = true;
options.dontLoad = true;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Finally, some defaults:
if (!options.excludeDirs) {
options.excludeDirs = /^\.(git|svn)$/;
}
if (!options.depth) {
options.depth = 10;
}
if (!options.filter) {
options.filter = /(.+)$/;
}
// Now call the low-lvl helper.
return helpIncludeAllSync(options);
};

2

package.json
{
"name": "include-all",
"version": "1.0.4",
"version": "1.0.5",
"description": "An easy way to include all node.js modules within a directory.",

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

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