Hogan.js is a 2.5k JS templating engine developed at Twitter. Use it as a part of your asset packager to compile templates ahead of time or include it in your browser to handle dynamic templates. If you're developing with Node.js, just use NPM to add the Hogan package. Hogan.js was developed against the mustache test suite, so everything that holds true for templates is also the case for hogan.js. That means you get variables, sections, lambdas, partials, filters, and everything else you've come to expect from mustache templating, only much, much faster. Use hogan.compile() to precompile your templates into vanilla JS. It's best to serve your templates precompiled whenever you can (rather than the raw templates), as parsing is the most time consuming operation. Once compiled, call the render() method with a context and optional partials object. If supplying partials, you can compile them ahead of time, or pass string templates.

Features

  • Hogan compiles templates to HoganTemplate objects
  • Hogan is fast, try it on your workload
  • Hogan has separate scanning, parsing and code generation phases
  • Add new features without touching the scanner at all
  • Hogan.js is a compiler for the Mustache templating language
  • Hogan exposes scan and parse methods

Project Samples

Project Activity

See All Activity >

Categories

Compilers, Languages

License

Apache License V2.0

Follow Hogan.js

Hogan.js Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Hogan.js!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Compilers, JavaScript Languages Software

Registered

2021-10-20