SHARE
TWEET

Untitled

a guest Jun 25th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2. const fs = require('fs');
  3. let i = 0;
  4. const printer = function () {
  5.   const fil = fs.createWriteStream('file');  
  6.   const MAX_LIM = 1e600;
  7.   const writer = function () {
  8.     let result = true;
  9.     while (i < MAX_LIM && result) {
  10.       result = fil.write(`->${i}<-\n`);
  11.       i += 1;
  12.     }
  13.     if (i < MAX_LIM)
  14.       fil.once('drain', writer);
  15.   }
  16.   return writer;
  17. }
  18. const printty = printer();
  19. printty();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top