My code seem to be working but I still get the following error:
Here is my functions.js
import { sleep } from "./helper.js";
const writeLog = async (message, delay, randomized) => {
for (let i = 0; i < message.length; i++) {
process.stdout.write(message[i]);
if (randomized) {
await sleep(Math.floor(Math.random() * delay));
} else {
await sleep(delay);
}
}
process.stdout.write('\n');
}
export const funkylog = ({delay, randomized}) => {
return (message) => {
writeLog (message, delay, randomized);
}
}
Please help.