Frontend to JavaScript Templating

npm install tjs
80 downloads in the last month


A frontend to javascript templating engines


application = new T('views/application.ejs'); //Loads views/application.ejs as an EJS template

application.update({username: 'admin'}); //Registers variable 'username' in this template
application.bind('body'); //Binds the template to the <body> element

application.update({username: 'guest'}); //Updates 'username' variable and pushes changes to the DOM

Note: Everything is chainable, so you can also do this:

new T('view/application.ejs')
   .update({username: 'admin'})
   .update({username: 'guest'});
npm loves you