For such kind of requirements where you have to put the array of data into Excel or CSV file, I have used fast-csv
in my case so I am writing code for that. Hope this will helps you. .
You can use the following code:
var fs = require('fs'); // using npm install fs module on application
var csv = require("fast-csv"); // I used this module in my case
var csvFileName = 'path of folder/file.csv';
var stream = fs.createReadStream(csvFileName); //reads the file
var headings = [];
var full = [];
headings.push('head1','head2','head3');
full.push(headings);
var csvStream = csv.createWriteStream({headers: true}),
ws = fs.createWriteStream(file_location);
csv.write(full, {headers: true}).pipe(ws);
ws.on("finish", function(){
response.redirect('/enriched'); // response is response parameter of your callback function
// redirect where you wants
});