jadequire
require jade files in node (synchronously)
Uses require.extensions[]
internally, and fs.readFileSync
, so be aware of the synchronous i/o happening if you use this (i.e. not in a request handler).
npm install jadequire
register handler
var jadequire = ; ;
...and require your jade files
//template.jadeh1 {#name}h2 I was the turkey the whole time!
// yes, this is synchronous i/o, so be careful where you use itvar tpl = ; ;
ZimI was the turkey the whole time!
unregister handler
jadequire; // removes '.jade' extension handler jadequire // specify handler to remove // jadequire also returns a handler that can be removedvar handler = ; handler; // removes the .jd extension handler