Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/tapable

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/tapable

TypeScript definitions for tapable

  • 1.0.12
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5M
decreased by-7.43%
Maintainers
1
Weekly downloads
 
Created

What is @types/tapable?

The @types/tapable package provides TypeScript type definitions for the Tapable library, which is used primarily in webpack for its plugin architecture. Tapable allows you to add and apply plugins to a JavaScript project. It offers various hooks like SyncHook, AsyncParallelHook, and more, which can be used to handle synchronous and asynchronous operations.

What are @types/tapable's main functionalities?

SyncHook

SyncHook allows for the synchronous execution of functions. The functions attached via `tap` will be executed in the order they were added when `call` is invoked.

import { SyncHook } from 'tapable';

const hook = new SyncHook(['arg1']);
hook.tap('PluginName', (arg1) => {
  console.log(`Value received: ${arg1}`);
});
hook.call('test');

AsyncParallelHook

AsyncParallelHook allows for the parallel execution of asynchronous functions. Functions can be added using `tapPromise` and are executed with `promise`.

import { AsyncParallelHook } from 'tapable';

const asyncHook = new AsyncParallelHook(['arg1']);
asyncHook.tapPromise('PluginName', (arg1) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      console.log(`Async value: ${arg1}`);
      resolve();
    }, 1000);
  });
});
asyncHook.promise('test').then(() => {
  console.log('All async plugins have finished');
});

Other packages similar to @types/tapable

FAQs

Package last updated on 21 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc