Easily require modules, even with custom names, using strings, arrays, or hashes.
creates a global 'need' function once required
then, you can "need" a module, by string name
//> [necessitate] Requiring underscore, as underscore.
also, returns a local function, with same functionality as the global "need"
n =
require with a hash, mapping your imported module (value) to any name (key)
//> [necessitate] Requiring underscore, as _.
use your array, string or hash when requring, all your imports.. on one line!
"underscore"//> [necessitate] Requiring underscore, as underscore.
Installation
npm install --save necessitate
Testing
npm test
Dependencies
- coffee-script: Unfancy JavaScript
- underscore: JavaScript's functional programming helper library.