bahmutov / really-need

Node require wrapper with options for cache busting, pre- and post-processing
MIT License
109 stars 4 forks source link

Configure default options at time require is replaced #16

Open santanubasu opened 9 years ago

santanubasu commented 9 years ago

Looking for a way to pass default options, applied to all require invocations (unless overridden by per-invocation options). So, I'd like to do things like this:

require = require('really-need')({... some default options...})

and then later on, in any given module:

var mymodule = require("mymodule")

where since I haven't supplied an options object, the defaults specified when I required really-need would be used.

great project btw, very innovative.

bahmutov commented 9 years ago

Hmm, that's a use case, I have to check the code what happens now