diff --git a/bin/node-sass b/bin/node-sass index 38cb69195..066a5b8d9 100755 --- a/bin/node-sass +++ b/bin/node-sass @@ -10,6 +10,7 @@ var Emitter = require('events').EventEmitter, glob = require('glob'), sass = require('../lib'), render = require('../lib/render'), + stdout = require('stdout-stream'), stdin = require('get-stdin'), fs = require('fs'); @@ -160,15 +161,7 @@ function getEmitter() { } }); - emitter.on('log', function(data) { - console.log(data); - }); - - emitter.on('done', function() { - if (!options.watch && !options.directory) { - process.exit(); - } - }); + emitter.on('log', stdout.write.bind(stdout)); return emitter; } diff --git a/package.json b/package.json index d63d4ad87..6e609a44c 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ "node-gyp": "^3.3.1", "npmlog": "^4.0.0", "request": "^2.61.0", - "sass-graph": "^2.1.1" + "sass-graph": "^2.1.1", + "stdout-stream": "^1.4.0" }, "devDependencies": { "coveralls": "^2.11.8",