1.0.3 • Published 6 years ago

is-async-await v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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
// ...