Jade、EJS、JSHTML、Mustache、Handlebars 五大node模板引擎区别

Here’s my feature matrix I used while comparing.

 Built into ExpressAllows logic in templatesEncourages logic in templatesReuse templates client sideAllows Bootstrap IntegrationIDE SupportPartialsNotes
JadeyesyesnoNoYesWebstorm, sublime with add-inYes + LayoutDefault for Express. Lots of add-ons available via npm. Documentation is incomplete but passable. Very clean syntax. Easily readable.
EJSyesyesyesyesYesWebstorm, sublime with add-inNoDefault for Sails.js. Very messy syntax.
JSHTMLyes but noyesno?????????NoAppears to be built in but isn’t. Instead need jshtml-express. No partials support. Missing variable in template is fatal error. Website is outdated. Automated tests are failing. Difficult to find documentation. Seeks to be familar to .net developers.
Mustacheyes (older version of hogan)nonoyesyesWebstorm with plugin, sublime with pluginYesVery popular client-side templating library, supported by many languages. Using logic-less templates can be frustrating at first
Handlebarsno, use express3-handlebarsnonoyesyesWebstorm with plugin, sublime with pluginYes + LayoutTemplate engine used by Ghost. Very popular client side library, superset of Mustache. Supports an easier to understand if syntax for those who want minimal logic.
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值