Skip to content
Toffee template engine wrapper providing server-side compiled templates for SocketStream apps
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.md
engine.js
package.json

README.md

NOT MAINTAINED ANYMORE

Toffee Template Engine wrapper for SocketStream 0.3.4

https://github.com/malgorithms/toffee

Use pre-compiled Toffee client-side templates in SocketStream.

Installation

npm install ss-toffee --save

ss.client.templateEngine.use(require("ss-toffee"));

Restart the server. From now on all templates will be pre-compiled and accessible via the toffee.templates object.

Usage

E.g. a template placed in

/client/templates/offers/latest.toffee

Can be rendered in your browser with

// assumes var ss = require("socketstream")
var html = ss.tmpl["/templates/offers/latest"].render({name: "Special Offers"})
// or for views
var html = ss.tmpl["/views/login"].render()
Something went wrong with that request. Please try again.