This package has been deprecated

Author message:

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

require-mapper

0.0.3 • Public • Published

require-mapper

Maps the project's local modules for an easy require access.
With simple key value mapping, the project's modules can be addressed more easily

Usage

Just map your modules

var Mapper = require("require-mapper"),
        mapper = new Mapper();

mapper.map({
    "my.module": "src/My.js"
});

And then...

Load your module using the map's keys:

_require("my.module")
  

Customize on initial phase (optional)

  • methodname - The method name to be used for require the modules
  • basepath - The base path for resolving the modules (default: ".")
  • data - The modules map
var Mapper = require("require-mapper"),
        mapper = new Mapper();

mapper.init({
    methodname: "requirexxx"
    basepath: "../",
    data:{
        "foo.module": "src/foo/Foo.js"
    }
});

// use your custom require method name
requirexxx("foo.module");
  

Readme

Keywords

none

Package Sidebar

Install

npm i require-mapper

Weekly Downloads

0

Version

0.0.3

License

MIT

Last publish

Collaborators

  • lastboy