Convert to ESM

This commit is contained in:
Nick Alteen
2024-11-15 12:30:35 -05:00
parent 14c58ed4a7
commit 081d9e881a
28 changed files with 32080 additions and 9796 deletions
+4 -8
View File
@@ -1,17 +1,13 @@
/**
* Wait for a number of milliseconds.
* Waits for a number of milliseconds.
*
* @param {number} milliseconds The number of milliseconds to wait.
* @returns {Promise<string>} Resolves with 'done!' after the wait is over.
*/
async function wait(milliseconds) {
return new Promise(resolve => {
if (isNaN(milliseconds)) {
throw new Error('milliseconds not a number')
}
export async function wait(milliseconds) {
return new Promise((resolve) => {
if (isNaN(milliseconds)) throw new Error('milliseconds is not a number')
setTimeout(() => resolve('done!'), milliseconds)
})
}
module.exports = { wait }