(text, interval=0.1)
| 12 | } |
| 13 | |
| 14 | async function slowSpacePrint(text, interval=0.1) { |
| 15 | for (let i = 0; i < text.length; i++) { |
| 16 | if (text[i] === 'I') { |
| 17 | // I's are displayed in lowercase for style: |
| 18 | process.stdout.write('i '); |
| 19 | } else { |
| 20 | // All other characters are displayed normally: |
| 21 | process.stdout.write(text[i] + ' '); |
| 22 | } |
| 23 | await sleep(interval); |
| 24 | } |
| 25 | console.log('\n'); // Print two newlines at the end. |
| 26 | } |
| 27 | |
| 28 | |
| 29 | async function main() { |