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
$300 in Free Credit for Your Google Cloud Projects Icon
$300 in Free Credit for Your Google Cloud Projects

Build, test, and explore on Google Cloud with $300 in free credit. No hidden charges. No surprise bills.

Launch your next project with $300 in free Google Cloud credit—no hidden charges. Test, build, and deploy without risk. Use your credit across the Google Cloud platform to find what works best for your needs. After your credits are used, continue building with free monthly usage products. Only pay when you're ready to scale. Sign up in minutes and start exploring.
Start Free Trial
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