npm.io
1.0.0 • Published 6 years ago

detect-missing-await

Licence
MIT
Version
1.0.0
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
8

detect-missing-await

This module helps you find missing await statements at runtime.

It is a runtime analog to the eslint "no-floating-promises" rule

Do not use this module in production It should be used for debugging only It mutates the Promise global and does magic with proxies This is dangerous

Installation

npm install detect-missing-await

Example usage

require('detect-missing-await')

async function main() {
  const promise1 = await Promise.resolve()
  const promise2 = Promise.resolve() // Will log as missing an `await` statement
}

main()