Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const readline = require('readline');
- console.log('start');
- Array.from(Array(100), (_, i) => i + 1).forEach(i => {
- setTimeout(() => {
- /*
- // ※ メッセージの長さが減少する場合は使えない
- process.stdout.write(`working... ${i}%\r`);
- /*/
- // child_process でも正常に動作させるには readlineを使う
- readline.clearLine(process.stdout);
- readline.cursorTo(process.stdout, 0);
- process.stdout.write(`working... ${i}%`);
- //*/
- }, i * 30);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement