// functions.js
import { sleep } from "./helper.js";
export const writeLog = async(s, delay) => {
for (let i in s) {
process.stdout.write(s[i]);
await sleep(delay);
}
process.stdout.write('\n');
}
// helper.js
export const sleep = (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
//solution.js
import { writeLog } from './functions.js';
const message = `
Hello, world 👋!
Let's make our Console Output Fun and Interactive in JavaScript and Node.js 🚀
`;
const delay = 1500;
writeLog(message, delay);
Platform feedback with all mistakes, it says that even writeLog not async