$ pnpm add -D plop @cli-toolbox/project
# or
$ npm install -D plop @cli-toolbox/project
After installing the packages, you have to create a plopfile.{js,mjs}
in the root of your project.
# CommonJS
$ touch plopfile.js
# or
# ECMAScript modules
$ touch plopfile.mjs
Then, you can add the following code to your plopfile.{js,mjs}
:
// plopfile.js
/** @param {import('plop').NodePlopAPI} plop */
async function config(plop) {
await plop.load('@cli-toolbox/project')
}
module.exports = config
OR
// plopfile.mjs
/** @param {import('plop').NodePlopAPI} plop */
export default async function config(plop) {
await plop.load('@cli-toolbox/project')
}
After that, you can run the following command:
# pnpm
$ pnpm plop
# or
# npm
$ npx plop