Created
February 25, 2015 07:20
-
-
Save alexanderankin/20f1e5aedc5c6a63c7f6 to your computer and use it in GitHub Desktop.
Jade got me feeling like 'undefined is not a fxn'
This file contains 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'); | |
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