Socket
Book a DemoInstallSign in
Socket

child-process-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

child-process-webpack-plugin

Webpack plugin to start background processes.

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Child Process Webpack Plugin

Webpack plugin for starting child processes after each build.

Installation

$ npm install child-process-webpack-plugin

Basic usage

In your webpack.config.js:

const ChildProcessPlugin = require('child-process-webpack-plugin');

module.exports = {
    // ...
    plugins: [
        new ChildProcessPlugin('echo Hello!')
    ]
    // ...
}

Options

new ChildProcessPlugin(config: array | object | string)

Ideally config is an array of child process configurations. Each config is an object with the following keys:

KeyTypeDefault valueDescription
commandString''The command to be executed
onceBooleanfalseRun the command only after the first build (true makes sense only in watch mode)
prefixString''Each line of the process output gets prefixed with this string
cwdString'.'Working directory the process will run in
envObject{PATH:process.env.PATH}Environment variables for the child process

If config is an object, it's interpreted as an array with a single configuration:

new ChildProcessPlugin([config])

If config is a string, it's interpreted as a single command:

new ChildProcessPlugin([{
    command: config
}])

If you don't like the array syntax, you can create multiple instances:

module.exports = {
    // ...
    plugins: [
        new ChildProcessPlugin(config1),
        new ChildProcessPlugin(config2)
    ]
    // ...
}

Example

For a complete example check the test folder.

FAQs

Package last updated on 14 Jan 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.