开发者

node.js - need help choosing a templating engine valid both client & server side with express

开发者 https://www.devze.com 2023-02-05 12:10 出处:网络
I want to code an application with Node.js where templates and rendering code out of json would be the same on client & server side.

I want to code an application with Node.js where templates and rendering code out of json would be the same on client & server side.

I would have like to use jquery templates as there is a port of jquery templates to Node.js through https://github.com/kof/node-jqtpl.

Nevertheless, with this solution, the templates开发者_运维百科 would be shared but not the rendering code.

Is there a templating solution where the template & rendering code would be the same ?

Thank you for your help

Jerome Wagner


https://github.com/janl/mustache.js/ Can be used on both server side and browser. Mustache is pretty awesome itself, never used it with Node.js per say, but had a go at it with Go, and it was nice. Give it a try.


try ICanHaz.

It's really really beautiful and easy to use. you can find an introduction here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号