src/index.js
function csvWrapForExcel(encoder) {
  // Pipe the CSV encoder to the ucs2 converter
  var converter = new Stream.Transform();
  var csvStream = new Stream.PassThrough();
  converter._transform = function(chunk, encoding, cb) {
    this.push(new Buffer(chunk.toString(), 'ucs2'));
    cb();
  };
  // Write the UCS2 BOM http://www.unicode.org/faq/utf_bom.html#bom1
  csvStream.write(new Buffer([0xFF, 0xFE]));
  return encoder.pipe(converter).pipe(csvStream);
}
function csvWrapForExcel(encoder) {
  // Pipe the CSV encoder to the ucs2 converter
  var converter = new Stream.Transform();
  var csvStream = new Stream.PassThrough();
  converter._transform = function(chunk, encoding, cb) {
    this.push(new Buffer(chunk.toString(), 'ucs2'));
    cb();
  };
  // Write the UCS2 BOM http://www.unicode.org/faq/utf_bom.html#bom1
  csvStream.write(new Buffer([0xFF, 0xFE]));
  return encoder.pipe(converter).pipe(csvStream);
}
function csvWrapForExcel ( encoder ) { // Pipe the CSV encoder to the ucs2 converter var converter = new Stream . Transform ( ) ; var csvStream = new Stream . PassThrough ( ) ; converter . _transform = function ( chunk , encoding , cb ) { this . push ( new Buffer ( chunk . toString ( ) , 'ucs2' ) ) ; cb ( ) ; } ; // Write the UCS2 BOM http://www.unicode.org/faq/utf_bom.html#bom1 csvStream . write ( new Buffer ( [ 0xFF , 0xFE ] ) ) ; return encoder . pipe ( converter ) . pipe ( csvStream ) ; }
X-Platform Excel encoder
X - Platform Excel encoder