Skip to content

Instantly share code, notes, and snippets.

@tohagan
Created August 2, 2023 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tohagan/dfccbcdbd9aed4873afbe82f0f3bdfb2 to your computer and use it in GitHub Desktop.
Save tohagan/dfccbcdbd9aed4873afbe82f0f3bdfb2 to your computer and use it in GitHub Desktop.
NodeJS async run() starter example
#!/usr/bin/env node
async function run() {
// do async stuff
console.log('')
}
// Start
run()
.then(() => {
console.error('COMPLETED')
debug('Completed app')
process.exit(0)
})
.catch((err) => {
console.error('FAILED')
console.error(err)
process.exit(1)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment