Socket
Book a DemoInstallSign in
Socket

massquire

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

massquire

Requires directories of modules into objects.

2.0.3
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Massquire

Similar to require-all, massquire requires directories of modules into objects.

Install

npm install massquire

Usage

var massquire = require('massquire');

var modules = massquire(dirname, opts);

Parameters

dirname

Type: String

The name of the directory (path) that should be required.

opts

Type: Object

opts.recurse

Type: Boolean
Default: true

Requires all modules in the given directory and its subdirectories by default. Set recurse to false to require only the given directory.

opts.include

Type: Function

Function that receives the full path of a file and should return true to include the file.

opts.exclude

Type: Function

Function that receives the full path of a file and should return true to exclude the file.

opts.includeDir

Type: Function

Function that receives the full path of a directory and should return true to include the directory.

opts.excludeDir

Type: Function

Function that receives the full path of a directory and should return true to exclude the directory.

opts.map

Type: Function
Default: Strip .js or .json and camelCase

Function that receives the filename for each module and should return the keyname where the module will be stored to the object.

function(filename) {
  // format the filename
  return key;
}
opts.resolve

Type: Function

Function that receives each required module and should return the desired module value.

function(module) {
  return module();
}

Keywords

require

FAQs

Package last updated on 09 Feb 2017

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.