post-command-hook-install-packages-plugin

1.1.1 • Public • Published

post-command-hook-install-packages-plugin NPM version

Install packages plugin for post-command-hook.

Install packages plugin for post-command-hook gives you a possibility to install specified packages after some command have been executed using the install-packages library.

Installation

$ npm install --save post-command-hook post-command-hook-install-packages-plugin

Usage

const PostCommandHook = require("post-command-hook");
const InstallPackagesPlugin = require("post-command-hook-install-packages-plugin");

const postCommandHook = new PostCommandHook({
  command: "npx",
  args: ["create-react-app", "myapp"],
});
postCommandHook.use(new InstallPackagesPlugin(["redux", "react-redux"]));

(async () => {
  await postCommandHook.run();
})();

API

new InstallPackagesPlugin(packages)

Constructs an instance of InstallPackagesPlugin class providing packages - an array of packages to be installed.

packages

Type: array

An array of packages to be installed.

installOptions

Type: object

Install options to be passed to install-packages module. See api section in its README

pluginOptions

Type: object

Plugin options

silent

Type: boolean

If there was an error while installing packages handle it just log it to console without throwing an error

name

Type: string

Plugin name to be used when logging error messages, if not specified a random uid will be used as a plugin name

License

MIT © Rushan Alyautdinov

Package Sidebar

Install

npm i post-command-hook-install-packages-plugin

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

5.25 kB

Total Files

4

Last publish

Collaborators

  • sinventor