JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 27955940
  • Score
    100M100P100Q223702F
  • License MIT

Check that given function is async (callback) function or not. Trying to guess that based on check if `callback`, `cb`, `done` or `next` exists as function argument name.

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 npmjs.com The MIT License

Check that given function is async (callback) function or not. Trying to guess that based on check if callback, cb, done or next exists as function argument name.

code climate standard code style travis build status coverage status dependency status

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
  • is-empty-function: Checks the given function (or fn.toString()) is with empty body - dont have body.
  • is-missing: Check that given name or user/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 or GeneratorFunction. The co 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.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github