【发布时间】:2015-01-20 15:27:36
【问题描述】:
我正在用它的 JavaScript API 编译我的 Stylus .styl 样式表:http://learnboost.github.io/stylus/docs/js.html
var stylus = require('../')
, str = require('fs').readFileSync(__dirname + '/test.styl', 'utf8');
stylus(str)
.set('filename', __dirname + '/test.styl')
.import('mixins/vendor')
.render(function(err, css){
if (err) throw err;
console.log(css);
});
它没有提到它使用的回调是同步的还是异步的。虽然根据我的经验,它 似乎 是同步的,但我不确定。是吗?
【问题讨论】:
标签: stylus