Skip to content

zodiake/gitTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

gitTest

router.get('/csv', function(req, res, next) { var stringfier = csv.stringify({ rowDelimiter: 'windows', columns: ['age', 'name'], header: true }); var parser = csv.parse(); var transformer = csv.transform(function(data) { console.log(data[0]); return { age: data[0], name: data[1] }; }); var path = join(__dirname, '/test.csv'); var readStream = fs.createReadStream(path);

res.attachment('test.csv');
readStream.pipe(parser).pipe(transformer).pipe(stringfier).pipe(res);

});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages