Skip to content

bonheur15/TemprJs

Repository files navigation

Squirrel

Tempr Js

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.

Why Temprjs?

Simply put, Temprjs is super lightweight, super fast, super powerful, and super simple.

Features

  • Helpers, filters
  • Great error reporting
  • 0 dependencies
  • Conditionals
  • Better quotes/comments support
    • ex. {{someval + "name }}" }} compiles correctly, while it fails with DoT or EJS
  • 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

Docs

We know nobody reads through the long and boring documentation in the ReadMe anyway, so head over to the documentation website:

📝 Coming soon

📓 Examples

Simple Template

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>

Conditionals

{{@if(it.somevalue === 1)}}
Display this
{{#else}}
Display this
{{/if}}

Loops

{{@each(it.somearray) => val, index}}
Display this
The current array element is {{val}}
The current index is {{index}}
{{/each}}

Sceenshoots

alt text

Resources

To be added

Projects using Temprjs

[]

😅 Nothing yet

Contributors

Made with ❤

About

Temprjs is a modern, configurable, and blazing fast template engine implemented in JavaScript.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors