CoffeeKup template engine wrapper providing server-side compiled templates for SocketStream apps
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

CoffeeKup Template Engine wrapper for SocketStream 0.3

Use pre-compiled CoffeeKup client-side templates in your app.


Add ss-coffeekup to your application's package.json file and then add this line to app.js:


Restart the server. From now on all templates will be pre-compiled and accessibale via the ss.tmpl object.


A template placed in


Can be rendered in your browser with

// assumes var ss = require('socketstream')
var html = ss.tmpl['offers-latest']({name: 'Special Offers'})


CoffeeKup templates do not require a VM or any other client-side library as each template is turned into pure JS code. This is great for convenience and performance, but can result in a lot of code being sent to the client vs other template solutions if your app has many templates.

Improvements and forks welcome.


When experimenting with CoffeeKup, or converting an app from one template type to another, you may find it advantageous to use multiple template engines and confine use of CoffeeKup to a sub-directory of /client/templates.

Directory names can be passed to the second argument as so:

ss.client.templateEngine.use(require('ss-coffeekup'), '/ck-templates');