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

来源:互联网 发布:淘宝买伟哥电话怎么说 编辑:程序博客网 时间:2024/05/24 05:50

Here’s my feature matrix I used while comparing.

 Built into ExpressAllows logic in templatesEncourages logic in templatesReuse templates client sideAllows Bootstrap IntegrationIDE SupportPartialsNotesJadeyesyesnoNoYesWebstorm, 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 firstHandlebarsno, 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.
0 0
原创粉丝点击