//http://www.npmjs.com npm地址
if(
filetype ==
'csv') {
let
csvfile =
fs.
readFileSync(
downLoadFilePath,
'utf-8');
csvfile =
csvfile.
replace(
/\t/
g,
',');//用逗号替换/t
let
dataBuffer =
Buffer.
concat([
new
Buffer(
'
\xEF\xBB\xBF
',
'binary'),
new
Buffer(
csvfile)]);//node不支持utf-8 - BOM 格式
fs.
writeFileSync(
downLoadFilePath,
dataBuffer,
'utf-8');
}