lib/encoder.js
function save(file, options) {
  var stream = fs.createWriteStream(file, options);
  function onSave() {
    stream.removeAllListeners();
    this.emit('save');
  }
  function onError(err) {
    stream.removeAllListeners();
    this.emit('error', err);
  }
  stream.on('finish', onSave.bind(this));
  stream.on('error', onError.bind(this));
  this.pipe(stream);
  return this;
}
function save(file, options) {
  var stream = fs.createWriteStream(file, options);
  function onSave() {
    stream.removeAllListeners();
    this.emit('save');
  }
  function onError(err) {
    stream.removeAllListeners();
    this.emit('error', err);
  }
  stream.on('finish', onSave.bind(this));
  stream.on('error', onError.bind(this));
  this.pipe(stream);
  return this;
}
function save ( file , options ) { var stream = fs . createWriteStream ( file , options ) ; function onSave ( ) { stream . removeAllListeners ( ) ; this . emit ( 'save' ) ; } function onError ( err ) { stream . removeAllListeners ( ) ; this . emit ( 'error' , err ) ; } stream . on ( 'finish' , onSave . bind ( this ) ) ; stream . on ( 'error' , onError . bind ( this ) ) ; this . pipe ( stream ) ; return this ; }
Pipe the output of this writer to a file.
Pipe the output of this writer to a file .