isasync
v1.0.0
Published
Checks whether a value is an async function
Downloads
3
Maintainers
Readme
What it's for?
This is Node.js library that checks whether a value is an async function
Install
npm:
$ npm install isasync --save
yarn:
$ yarn add isasync
Example
const isAsync = require('isasync');
console.log(isAsync("hello world")); // > false
console.log(isAsync(function() {})); // > false
console.log(isAsync(async function() {})); // > true
console.log(isAsync(class {})); // > false
console.log(isAsync(() => {})); // > false
console.log(isAsync(async () => {})); // > true
console.log(isAsync(123)); // > false
console.log(isAsync({})); // > false
console.log(isAsync([])); // > false