0.0.3 • Published 8 years ago
necessitate v0.0.3
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"
n = 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
- coffee-script: Unfancy JavaScript
- underscore: JavaScript's functional programming helper library.
0.0.3
8 years ago