I am trying to create a file with dummy data. Since the file will be huge with 32^5 data points, I was using the write-stream. But I cannot see any data being written to the file. What could be the reason for this?
const faker = require('faker');
const fs = require('fs');
const os = require('os');
const MAX_DATA_POINTS = Math.pow(32, 5)
const stream = fs.createWriteStream('sample-data.csv', { flags : 'a' });
for(let i = 0; i < MAX_DATA_POINTS; i++) {
console.log(i)
stream.write(`${faker.name.findName()}, ${i} ${os.EOL}`);
}
console.log(`Written ${MAX_DATA_POINTS} .. `);