node.js - What is the right way to share a jade template to other modules -


so i'm getting started on project uses node , jade templates generate card game prototype pdfs. make project more useful others, considering trying package several jade templates in module standard card layouts extended user specific needs. problem approach can't think of way have jade templates extend jade templates without hairy access node_modules files. there better way?

you can export collection of templates node module.

say module called "tpl-cards", can do:

module.exports = {   main_lib: function() {     /* main lib */   },   templates: [     /* list of templates */   ] } 

then users can do:

var templates = require('tpl-cards').templates; 

Comments