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

load-from-directory

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load-from-directory - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

README.md

20

index.js

@@ -68,16 +68,26 @@ /**

/**
* Loads all modules from directory, returns array
* Loads all modules from directory, returns object
* @param root_directory Relative path to root_directory where modules should be loaded from
* @param options [{}] See .load() for more information
* @returns {Array} Array containing modules
* @returns {Object} Object containing modules w/key as module_name
*/
exports.loadArray = function( root_directory, options ) {
exports.loadObject = function( root_directory, options ) {
options = options || {};
_.defaults( options, {
caller_directory: path.dirname( callsite()[ 1 ].getFileName() ) // Set this here, because when we call load we fuck up the stacke
caller_directory: path.dirname( callsite()[ 1 ].getFileName() ) // Set this here, because when we call load we fuck up the stack
} );
// Load the modules
var loaded = exports.load( root_directory, options );
return exports.load( root_directory, options );
};
/**
* Loads all modules from directory, returns array
* @param root_directory Relative path to root_directory where modules should be loaded from
* @param options [{}] See .load() for more information
* @returns {Array} Array containing modules
*/
exports.loadArray = function( root_directory, options ) {
var loaded = exports.loadObject( root_directory, options );
// Use map to convert the object into a value array

@@ -84,0 +94,0 @@ return _.map( loaded, function( item ) {

{
"name": "load-from-directory",
"version": "1.0.2",
"version": "1.0.3",
"description": "Loads all modules from the given directory into an array",

@@ -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