Skip to content

Instantly share code, notes, and snippets.

@alexanderankin
Created February 25, 2015 07:20
Show Gist options
  • Save alexanderankin/20f1e5aedc5c6a63c7f6 to your computer and use it in GitHub Desktop.
Save alexanderankin/20f1e5aedc5c6a63c7f6 to your computer and use it in GitHub Desktop.
Jade got me feeling like 'undefined is not a fxn'
var fs = require('fs');
var jade = require('jade');
var writetofile = function(e){
// convert string to buffer so i can write it
var f = new Buffer(e, 'ascii');
// this is sitting in a folder where i can
// compare it to the html i have
fs.writeFile('/resources/wusbhtml/index1.html', f)
}
//./views/index.jade isnt done yet but im learning jade
// so i can port this site from php into something
// I know (err, *ahem* dont know /yet!/)
var fn = jade.compileClient(fs.readFileSync('./views/index.jade', {encoding: 'ascii'}), {pretty:true});
writetofile(fn(locals)) // wtf is locals?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment