Last active
August 19, 2016 08:13
-
-
Save alfredwesterveld/3bba1bad32b35ba21d12db37bf90b457 to your computer and use it in GitHub Desktop.
Keep printing to same line from [0, 100]. When done print done on same line and exit program.
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
| const log = require('single-line-log').stdout | |
| let i = 0 | |
| const id = setInterval(() => { | |
| log(i++) | |
| if (i === 100) { | |
| clearInterval(id) | |
| log.clear() | |
| log('done\n') | |
| } | |
| }, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment