title: How can I disable nodejs ChildProcess.spawn stdout buffer?
body: <p>I'm trying to intercept <code>compass watch</code> output using the following code:</p>
  
  <pre><code>var spawn = require('child_process').spawn;
  
  var child = spawn('compass', ['watch'], { cwd: process.cwd() });
  
  process.on('data', function (data) {
      console.log('[log] ' + data);
  });
  </code></pre>
  
  <p>My problem is: I have to save the file twice for the overwrite message to come out in stdout. Here's a sample output...</p>
  
  <p>after <code>node compass.js</code></p>
  
  <pre><code>[log] &gt;&gt;&gt; Compass is watching for changes. Press Ctrl-C to Stop.
  </code></pre>
  
  <p>after I've saved the file</p>
  
  <pre><code>[log] &gt;&gt;&gt; Change detected at 20:17:19 to: components/_avatar.scss
  </code></pre>
  
  <p>after I save the file for the second time</p>
  
  <pre><code>[log] overwrite assets/css/modules/projects.css 
  &gt;&gt;&gt; Change detected at 20:17:26 to: components/_avatar.scss
  </code></pre>
  
  <p>It looks like the "overwrite assets/css/modules/projects.css" is being buffered. Is there any way I can avoid this buffer?</p>