Mozilla maintains Nunjucks (https://mozilla.github.io/nunjucks/), a templating library written in Javascript. Apparently drew its inspiration from Jinja, which is a really good templating lib in Python.
I was looking for a templating library, written in Javascript, that supported conditional statements and inline importing files. Handlebars and co. do not, from what I saw, support inline imports as you have to register "partials" in code which is not ideal. Look, when writing code generation software the template files can get quite big and yuck with all the control statements and blocks. I wanted a way to split the files into manageable chunks and Nunjucks delivers.
You can even precompile your templates if you wanted performance. It is targeted for html templates though.
A bonus is that you can define macros, which I use to split up common pieces such as function argument formats or partial SQL statements.
So far, I really happy with this choice of templating library combined with a prettify library.