Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const fs = require('fs');
- let i = 0;
- const printer = function () {
- const fil = fs.createWriteStream('file');
- const MAX_LIM = 1e600;
- const writer = function () {
- let result = true;
- while (i < MAX_LIM && result) {
- result = fil.write(`->${i}<-\n`);
- i += 1;
- }
- if (i < MAX_LIM)
- fil.once('drain', writer);
- }
- return writer;
- }
- const printty = printer();
- printty();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement