生成为:
body { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAUCAYAAABMDlehAAAABmJLR0QA/wD/AP+gvaeTAAAAI0lEQVQImWP4+fPnf6bPnz8zMH358oUBwkIjKJBgYGNj+w8Aphk4blt0EcMAAAAASUVORK5CYII="); background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #000)); background: -webkit-linear-gradient(top, #fff 0%, #000 100%); background: -moz-linear-gradient(top, #fff 0%, #000 100%); background: linear-gradient(top, #fff 0%, #000 100%); }nodemon 插件
# npm install nodemon -g
1 var css = require("stylus"), 2 str = require("fs").readFileSync("style.styl", "utf8"); 3 4 css.render(str, { filename: "stylus.styl" }, function(err, css) { 5 if (err) throw err; 6 var http = require('http'); 7 http.createServer(function (req, res) { 8 res.writeHead(200, {'Content-Type': 'text/css'}); 9 res.end(css); 10 }).listen(1337, '127.0.0.1'); 11 console.log('已经启动 :1337/'); 12 });