This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

require-mod

0.0.4 • Public • Published

Require Modifier (require-mod)

RequireMod is a NodeJS-Package which provides the functionality to modify the require-process of a nodejs-module instance.

Installation

This module is installed via npm:

$ npm install require-mod

Usage

Include the ProxyScope constructor:

var ProxyScope = require('require-mod').ProxyScope;

Create a new proxyScope:

var scope = new ProxyScope(module);

Register a redirection:

scope.when(/^fs$/).redirect("fse");
 
var fse = require("fs"); // the "fse" module instance 

After the regitration the require function of the current module has been modified and loads the registered module-proxy

The Module is also Typescript compatible, you can use the mtype:require-mod to install the definitions.

Readme

Keywords

Package Sidebar

Install

npm i require-mod

Weekly Downloads

3

Version

0.0.4

License

BSD-3-Clause

Last publish

Collaborators

  • alex20465