You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@webgap/require-utils

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webgap/require-utils

Automatically requires modules with a specific pattern from a specific directory.

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

WebGAP Require Utils

Build Status Test Coverage Code Climate Dependency Status

NPM version NPM downloads

README

This is an utility tool to load multiple node.js modules in parallel.

Dependencies

Handles files/ folders search using fs-finder.
Handles async implementation using async.

API

Installation

npm install @webgap/require-utils --save

Usage

If you want to load module files from a specific directory:

var req = require('../index').require;

req({
  "require": [{
    "directories": ['path/to/lib'],
    "pattern": 'auth-*.js'
  }]
}, function afterRequire(err, modules) {
  assert.equal(err, undefined);
  assert.notEqual(err, modules);
  done();
});

If you want to load modules from a specific directory:

req({
  "require": [{
    "directories": ['path/to/modules'],
    "pattern": 'auth-*'
  }]
}, function afterRequire(err, modules) {
  assert.equal(err, undefined);
  assert.notEqual(err, modules);
  done();
});

Check tests folder.

License

Apache License, Version 2.0

Keywords

webgap

FAQs

Package last updated on 11 Dec 2015

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