Skip to content

Instantly share code, notes, and snippets.

@joemccann
Created April 5, 2011 17:40
Show Gist options
  • Save joemccann/904081 to your computer and use it in GitHub Desktop.
Save joemccann/904081 to your computer and use it in GitHub Desktop.
Does it write to a file?
var express = require('express')
, css = require('stylus')
, str = require('fs').readFileSync(__dirname + '/public/css/style.styl', 'utf8');
// What makes sense to me is pass in "str" to be rendered and write that data to the file named "style.css".
// But examples show it being named "style.styl" which I thought was already loaded from "str"???
css.render(str, {filename: __dirname + '/public/css/style.css'}, function(err, css){
if (err) throw err;
console.log(css);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment