Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 359 Bytes

README.md

File metadata and controls

23 lines (19 loc) · 359 Bytes

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()
})()