Skip to content

Wraps an async function so it can called synchronously

License

Notifications You must be signed in to change notification settings

cortexteam/wrap-async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wrap-async

Wraps an async function so it can called synchronously

Usage:

Import:

const wrap = require('wrap-async')

Express controller:

exports.getRequest = wrap(async function (req, res) {
  res.status(200)
})

Immediate invocation:

wrap(async function() {
  return await http()
})()

About

Wraps an async function so it can called synchronously

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published