mustacheplus

为express中间件封装了一下,最重要是添加了模板嵌套特性

npm install mustacheplus
1 downloads in the last week
4 downloads in the last month

mustache-node-plus

为express中间件封装了一下,最重要是添加了模板嵌套特性

example

var app = express();
var _mustacheplus = require('mustacheplus');
_mustacheplus.prefix=__dirname+"/templates/";//设置模板的路径前缀
app.engine("html", _mustacheplus); 
app.set('views', __dirname + '/templates');

template:

<body>
        {include tpl="store/header.html"}   <!-- relative path -->
        <div id="content">
        </div>
        {include tpl="store/footer.html"}
</body>
npm loves you