# tappable

> Tapable with Promise support

Latest version **1.1.0** (published 2017-07-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install tappable
pnpm add tappable
yarn add tappable
bun add tappable
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2017-07-17 |
| First published | 2017-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Pooya Parsa |
| Maintainers | pi0 |
| Keywords | tapable, promise, async, await, webpack, q, co |

## Links

- npm: https://www.npmjs.com/package/tappable
- Repository: https://github.com/pi0/tappable
- Homepage: https://github.com/pi0/tappable#readme
- Issues: https://github.com/pi0/tappable/issues
- npm.io page: https://npm.io/package/tappable

## Dependencies (2)

- [pify](https://npm.io/package/pify.md) ^3.0.0
- [tapable](https://npm.io/package/tapable.md) ^0.2.6

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2017-07-17
- 1.0.1 — 2017-06-13

## README

[![CircleCI](https://img.shields.io/circleci/project/github/pi0/tappable.svg?style=flat-square)](https://circleci.com/gh/pi0/tappable)
[![Codecov](https://img.shields.io/codecov/c/github/pi0/tappable.svg?style=flat-square)](https://codecov.io/gh/pi0/tappable)
[![npm](https://img.shields.io/npm/v/tappable.svg?style=flat-square)](https://www.npmjs.com/package/tappable)

# Tappable
> [Tapable](https://www.npmjs.com/package/tapable) with promise support.

## Setup
```bash
yarn add tappable
# or
npm install --save tappable
```
```js
// Require module
const Tapable = require('tappable')
```

## Usage
For basic usage please see [tapable](https://github.com/webpack/tapable) docs.

### `applyPlugins*`
This functions are wrapped with [pify](https://www.npmjs.com/package/pify) 
and return promise too.

```js
// Using async/await
await this.applyPluginsAsync('init')

// Using Promise
this.applyPluginsAsync('init')
.then(() => {
  // Applied
})
.catch(err => {
  // Some error happened
})
```

### `plugin(names, handler)`
When register plugins `handler` function can also return promise instead of calling `callback` argument.

```js
webpack.plugin('init', async () => {
  // You can use async/await here  
})

// or
webpack.plugin('init', () => new Promise((resolve, reject) => {
  // Call resolve() or rejcet() when finished or chain promise
}))
```

# License

MIT

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