Package Exports
- is-async-function
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-async-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-async-function

Check that given function is async (callback) function or not. Trying to guess that based on check if
callback
,cb
,done
ornext
exists as function argument name.
Install
npm i is-async-function --save
npm test
Usage
For more use-cases see the tests
var isAsyncFunction = require('is-async-function')
var fs = require('fs')
isAsyncFunction(fs.readFile) //=> true
isAsyncFunction(fs.rename) //=> true
isAsyncFunction(fs.chown) //=> true
isAsyncFunction(fs.readFileSync) //=> false
isAsyncFunction(fs.renameSync) //=> false
isAsyncFunction(fs.chownSync) //=> false
isAsyncFunction(fs.createReadStream) //=> false
var request = require('request')
var got = require('got')
isAsyncFunction(request) //=> true
isAsyncFunction(got.get) //=> true
isAsyncFunction(got.post) //=> true
isAsyncFunction(got) //=> true
Related
- is-empty-function: Checks the given function (or fn.toString()) is with empty body - dont have body.
- is-missing: Check that given
name
oruser/repo
exists in npm registry or in github more - is-installed: Checks that given package is installed on the system - globally or locally.
- is-glob: Returns
true
if the given string looks like a glob pattern. - is-es6-generators: Check whether a value is a
Generator
orGeneratorFunction
. Theco
way, more strict checking. Always return boolean true or false, never null or undefined. - npm-related: Thin wrapper on top of
helper-related
for generating a list of links to the homepages of related NPM projects.
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.