Skip to content

Instantly share code, notes, and snippets.

@ibrahimgunduz34
Last active November 14, 2021 15:33
Show Gist options
  • Select an option

  • Save ibrahimgunduz34/f743670efc4907ceaca93a8b0a7ff945 to your computer and use it in GitHub Desktop.

Select an option

Save ibrahimgunduz34/f743670efc4907ceaca93a8b0a7ff945 to your computer and use it in GitHub Desktop.
`use strict`;
const fs = require('fs');
const writeStream = fs.createWriteStream('sample.txt');
const row = ['John', 'Doe', '905412223344','john.doe@example.com', 'Lorem Ipsum Street Nr. 2', 'Istanbul', 'Trukey'];
const sRow = row.join(';') + '\n';
const targetSize = Math.floor((500 * 1024 * 1024) / sRow.length);
for (let i = 0; i < targetSize; i++) {
writeStream.write(sRow);
}
writeStream.end();
console.log('The process has been completed.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment