
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
event-hooks-webpack-plugin
Advanced tools
Execute JavaScript on any available Webpack event hook
This Webpack plugin is similar to webpack-shell-plugin
but it allows executing
arbitrary code instead of commands on any compiler hook that is made available by Webpack.
npm install event-hooks-webpack-plugin --save-dev
import EventHooksPlugin from 'event-hooks-webpack-plugin';
export default {
// ...
plugins: [
new EventHooksPlugin({
initialize: () => {
// ...
}
})
]
};
The plugin consumes an object with Webpack compiler event hook names (e.g. run
, compile
,
and done
) as keys and functions as values.
Webpack's compiler uses Tapable which supports different classes of hooks. This plugin supports
synchronous, promise-based, and callback-based hooks through the exported tap
, tapPromise
and tapAsync
methods.
By default, the plugin uses tap
.
import EventHooksPlugin, { tapPromise, tapAsync } from 'event-hooks-webpack-plugin';
export default {
// ...
plugins: [
new EventHooksPlugin({
emit: tapAsync(() => {
// ...
}),
run: tapPromise(() => {
// ...
})
})
]
};
FAQs
Execute JavaScript on any available Webpack event hook
The npm package event-hooks-webpack-plugin receives a total of 10,720 weekly downloads. As such, event-hooks-webpack-plugin popularity was classified as popular.
We found that event-hooks-webpack-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.