@jazim/plop-install
v1.0.0
Published
Plop generator for installing npm packages
Maintainers
Readme
plop-install
A custom action for Plop.js that allows you to install npm packages as part of your generator workflow.
Installation
npm install -D @jazim/plop-install
# or
yarn add -D @jazim/plop-install
# or
pnpm add -D @jazim/plop-installUsage
Import the action in your plopfile.js or plopfile.ts:
import { NodePlopAPI } from "plop";
import { type InstallPackageActionConfig, installPackageAction } from "@jazim/plop-install";
export default function (plop: NodePlopAPI) {
plop.setActionType("install-package", installPackageAction);
plop.setGenerator("eslint", {
description: "Add an eslint",
actions: [
{
type: "install-package",
packages: ["eslint"],
options: { dev: true },
} as InstallPackageActionConfig,
],
});
}Options
The install-package action accepts the following configuration:
| Option | Type | Description |
|--------|------|-------------|
| packages | string[] | Array of package names to install |
| options | object | Additional options for installation |
| options.dev | boolean | Install as dev dependency when set to true |
Features
- 📦 Install any npm packages during your plop generation
- 🛠️ Support for devDependencies
- 📋 Works with npm, yarn, and pnpm
- 🔄 Seamlessly integrates with your existing plop generators
License
MIT
