Created
June 5, 2012 05:12
-
-
Save gsf/2872787 to your computer and use it in GitHub Desktop.
kernel and whiskers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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