New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

recursive-loader

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recursive-loader

Load modules recursive and save them in an object.

0.0.2
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Recursive Loader Build Status

Load modules recursive and save them in an object.

Getting Started

Install the module with: npm install recursive-loader

var loader = require('recursive-loader'),
    modules = loader.load('./my-modules');

modules.myFunction();
// OR
modules.world.hello();

Documentation

Configuration

priority
  • Type: String,
  • Default: directory

Specifies the priority you want to use. For example, file.

formatFilename
  • Type: Function,
  • Default: Return camlized filename
formatDirname
  • Type: Function,
  • Default: Return camlized dirname

Usage examples

Use file as priority for loading modules.

var loader = require('recursive-loader');

loader.priority = 'file';

// load and use modules

Use custom formatter for file or dirname.

var loader = require('recursive-loader');

loader.formatFilename = function(filename) {
    
    return filename.replace('-', '').toUpperCase();
};

loader.formatDirname = function(dirname) {
    
    return dirname.replace('-', '').toLowerCase();
};

// load and use modules

License

Copyright (c) 2014 Florian Goße. Licensed under the MIT license.

Keywords

module

FAQs

Package last updated on 12 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts