Last active
November 14, 2021 15:33
-
-
Save ibrahimgunduz34/f743670efc4907ceaca93a8b0a7ff945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| `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