ss-toffee

Toffee-Templates for SocketStream 0.3

npm install ss-toffee
12 downloads in the last week
24 downloads in the last month

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()
npm loves you