Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/southpolesteve/detect-missing-await
Detects potential missing `await` calls in JavaScript/Typescript at runtime
https://github.com/southpolesteve/detect-missing-await
Last synced: 2 months ago
JSON representation
Detects potential missing `await` calls in JavaScript/Typescript at runtime
- Host: GitHub
- URL: https://github.com/southpolesteve/detect-missing-await
- Owner: southpolesteve
- License: mit
- Created: 2019-12-06T21:29:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-06T21:56:24.000Z (about 5 years ago)
- Last Synced: 2024-11-01T09:48:39.231Z (2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md)
> 🚨 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
```js
require('detect-missing-await')async function main() {
const promise1 = await Promise.resolve()
const promise2 = Promise.resolve() // Will log as missing an `await` statement
}main()
```