# maybe-callback

> Maybe call a callback if it's a function

Latest version **2.1.0** (published 2016-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install maybe-callback
pnpm add maybe-callback
yarn add maybe-callback
bun add maybe-callback
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2016-01-26 |
| First published | 2014-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Rob Skillington |
| Maintainers | robskillington |
| Keywords | utility, events, callbacks |

## Links

- npm: https://www.npmjs.com/package/maybe-callback
- Repository: https://github.com/robskillington/maybe-callback
- Issues: https://github.com/robskillington/maybe-callback/issues
- npm.io page: https://npm.io/package/maybe-callback

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2016-01-26
- 1.0.0 — 2014-09-30

## README

# maybe-callback [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]

> Maybe call a callback if it really is who it says it is.


## Installation

[Node.js](http://nodejs.org/) is required. To install, type this at the command line:
```shell
npm install maybe-callback
```


## Usage
```js
var maybeCallback = require('maybe-callback');
 
function callback(arg) {
    return arg + 1;
}

maybeCallback(callback)(1);  //=> 2
maybeCallback(null)(1);  //=> undefined

var once = maybeCallback.once(callback);
once(1); //=> 2
once(1); //=> undefined
```


[npm-image]: https://img.shields.io/npm/v/maybe-callback.svg
[npm-url]: https://npmjs.org/package/maybe-callback
[travis-image]: https://img.shields.io/travis/robskillington/maybe-callback.svg
[travis-url]: https://travis-ci.org/robskillington/maybe-callback

---
_Source: https://npm.io/package/maybe-callback · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
