Documentation (Comming soon) - Playground (Coming Soon)
Summary
Temprjs is a modern, configurable, and blazing fast template engine implemented in JavaScript. It works out of the box with ExpressJS And you can set any server (GO,APACHE,...) to work through api direct and the full version weighs only ~4KB gzipped.
This is version 2 - a new, more powerful rewrite of Temprjs. It adds multiple features (like filter parameters, whitespace control, partials, and template inheritance) to bring you a template engine with the power of Creating Templates at Lighting fast speed, the simplicity of EJS, and the small bundle size of its earlier versions.
Simply put, Temprjs is super lightweight, super fast, super powerful, and super simple.
- Helpers, filters
- Great error reporting
- 0 dependencies
- Conditionals
- Better quotes/comments support
- ex.
{{someval + "name }}" }}compiles correctly, while it fails with DoT or EJS
- ex.
- Exports ES Modules as well as UMD
- Loops
- Custom delimeters
- Easy template syntax
- Precompilation
- Partials
- Inline JavaScript
- Comments
- Caching
- 🚀 Super Fast
- Benchmarking performance (Coming Soon)
- Async support: async filters, helpers, partials
- Template inheritance
We know nobody reads through the long and boring documentation in the ReadMe anyway, so head over to the documentation website:
var myTemplate = "<p>My favorite kind of cake is: {{it.favoriteCake}}</p>"
Sqrl.render(myTemplate, {favoriteCake: 'Chocolate!'})
// Returns: '<p>My favorite kind of cake is: Chocolate!</p>
{{@if(it.somevalue === 1)}}
Display this
{{#else}}
Display this
{{/if}}
{{@each(it.somearray) => val, index}}
Display this
The current array element is {{val}}
The current index is {{index}}
{{/each}}
To be added
[]
😅 Nothing yet
Made with ❤
