Closed chenfei-hnu closed 4 years ago
/** * 保存CSV文件 * @param {String} fileName 文件地址 * @param {String} content 文件内容 * @return */ function saveCsv(fileName, content) { // 防止excel打开乱码: https://github.com/f2e-journey/xueqianban/issues/34 const msExcelBuffer = Buffer.concat([ new Buffer('\xEF\xBB\xBF', 'binary'), new Buffer(content) ]); fs.writeFileSync(fileName, msExcelBuffer); }
保存CSV文件