tappable

Tapable with Promise support

please use https://www.npmjs.com/package/hookable
Last updated 4 years ago by pi0 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install tappable 
SYNC missed versions from official npm registry.

CircleCI Codecov npm

Tappable

Tapable with promise support.

Setup

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

Usage

For basic usage please see tapable docs.

applyPlugins*

This functions are wrapped with pify and return promise too.

// 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.

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

Current Tags

  • 1.1.0                                ...           latest (4 years ago)

2 Versions

  • 1.1.0 [deprecated]           ...           4 years ago
  • 1.0.1 [deprecated]           ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 28
Last Day 1
Last Week 18
Last Month 52
Dependencies (2)
Dev Dependencies (2)

Copyright 2014 - 2017 © taobao.org |