is-async-await
v1.0.3
Published
Function to check if the argument is a function that uses async / await
Downloads
1
Maintainers
Readme
is-async-await
A small function that checks if the passed in argument is an async function
installation
npm i --save is-async-await
or if using yarn
yarn add is-async-await
usage
import isAsync from 'is-async-await'
// True
console.log(isAsync(async function fn() {})) // true
console.log(isAsync(async () => {})) // true
// False
console.log(() => {}) // false
console.log(function fn() {}) // false
console.log({}) // false
console.log([]) // false
console.log('String') // false
console.log(0) // false
// ...