Skip to content

brzez/js-view-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple template engine for js

Works in node & browsers.

Written for the a-k-apart.com contest as a part of a different project. The main goal was to take as low space as possible. Minified it takes around 2kb which is ok.

It might be a bit bugged. The aim was to write it well enough so the other project is working.

** This shouldn't probably be used by anyone. just use hbs / mustache / whatever **

spec

  1. Render variable (escaped)
{{ variable }}
  1. Conditionals Data:
{
    thing: 123
}
{{# thing}} will render {{/}}
{{#! thing}} won't render {{/}}
  1. loops
something = [
    {value: 1},
    {value: 2}
];
{{@ something}}
    {{ value }}
{{@}}

There is no support for array items in loops.

About

A templating engine for js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published