Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
244 views
in Technique[技术] by (71.8m points)

node.js - What are the differences between the express-handlebars, express-hbs and hbs modules,

I'm trying to use Handlebars with Express, and I found the modules express-handlebars, express-hbs and hbs which all seem to work similarly. What are the main differences between them that I should be aware of, given that I need to able to use layouts and partials?

question from:https://stackoverflow.com/questions/26832076/what-are-the-differences-between-the-express-handlebars-express-hbs-and-hbs-mod

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Looks like the comment above needs to be updated a bit.

Updated list is here:

  1. Express-handlebars

Seems to be the most popular package at the moment. There is live chat on gitter. Dependencies are up-to date and current npm version is 3.0.0. Last update 29 days ago (at the moment of this post) One important thing is about its license - it's licensed by Yahoo Inc (others are MIT licensed).

There is really good documentation in README with extended explanation of every feature including API information. Here you will find both basic and advanced usage.

One difference in comparison with other packages is an ability to use Hooks. In this way you can override some functionality of ExpressHandlebars instances.

  1. hbs

Easy to use view engine with almost the same functionality as in Express-handlebars, but last activity was 4 months ago. Anyway tests are green at the moment. Has MIT license.

  1. Express-hbs

This package is written by guys from Barc. Can be used with both express 3/4 versions. It says about i18n support which is good, but it's also easy to integrate i18n everywhere else so I'd not say it's a feature. Has MIT license.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...