necessitate

0.0.3 • Public • Published

Build Status npm version

Easily require modules, even with custom names, using strings, arrays, or hashes.

creates a global 'need' function once required

require('necessitate')

then, you can "need" a module, by string name

necessitate("underscore")
//> [necessitate] Requiring underscore, as underscore.

also, returns a local function, with same functionality as the global "need"

= require("necessitate")

require with a hash, mapping your imported module (value) to any name (key)

n({_:"underscore"})
//> [necessitate] Requiring underscore, as _.

use your array, string or hash when requring, all your imports.. on one line!

require('necessitate')(["underscore"])
//> [necessitate] Requiring underscore, as underscore.

Installation

npm install --save necessitate

Testing

npm test

Dependencies

/necessitate/

    Package Sidebar

    Install

    npm i necessitate

    Weekly Downloads

    10

    Version

    0.0.3

    License

    ISC

    Last publish

    Collaborators

    • mralexgray