DEV Community

Discussion on: Using await/async in a Simple Script

Collapse
 
henryjw profile image
Henry Williams

I generally don't like to use this pattern except for initializing something like a database connection or something of the sort at the end of the script.


module.exports.runQuery = async query => {
    ....
}

(async () => {
    await initializeDatabase()
})()
Enter fullscreen mode Exit fullscreen mode