Skip to content

Instantly share code, notes, and snippets.

@gsf
Created June 5, 2012 05:12
Show Gist options
  • Select an option

  • Save gsf/2872787 to your computer and use it in GitHub Desktop.

Select an option

Save gsf/2872787 to your computer and use it in GitHub Desktop.
kernel and whiskers
var fs = require('fs')
// kernel
var kernel = require('kernel')
kernel('t2.html', function(err, tmpl) {
if (err) throw err
tmpl({
title: function(cb) {
fs.readFile('bob', cb)
}
}, function(err, html) {
if (err) throw err
console.log(html)
})
})
// whiskers
var whiskers = require('whiskers')
fs.readFile('t.html', function(err, tmpl) {
if (err) throw err
fs.readFile('bob', function(err, title) {
if (err) throw err
console.log(whiskers.render(tmpl, {title: title}))
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment