title: Nodejs: can I set objectMode of stream.Transform like this?
body: <p>can I set objectMode like the following code?
  if not, how to fix it?</p>
  
  <p>tks, bro.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class com extends stream.Transform {
      constructor(opt) {
          super(Object.assign({}, {objectMode: true}, opt));
      }
      _transform(chunk, enc, callback) {
          let ret = compiler(chunk);
          this.push(ret);
          callback();
      }
  }
  
  let st = fs.createReadStream('./com/a.com');
  let wr = fs.createWriteStream('./com/b.com');
  let c = new com({objectMode: true});
  st.pipe(c).pipe(wr);</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>run it, and got some error.</strong>
  I run it in nodeV6.11.1, but got error:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>TypeError: Invalid non-string/buffer chunk
      at validChunk (_stream_writable.js:211:10)
      at WriteStream.Writable.write (_stream_writable.js:241:21)
      at com.ondata (_stream_readable.js:555:20)</code></pre>
  </div>
  </div>
  </p>
  
  <p>anything wrong in my code?</p>