(scaff
is short word of "scaffolding")
Scaffold your frequently used files or folder structure using file based templates.
$ yarn global add scaff-cli
// or
$ npm install -g scaff-cli
$ mkdir -p .scaff/my-component
$ touch .scaff/my-component/index.js
$ touch .scaff/my-component/{{name}}.js
$ vi .scaff/my-component/{{name}}.js
// export default function {{name}} {}
my-component
is folder name you wrote in .scaff
folder.
$ scaff g
? Choose your template my-component
? Where to copy them? ./src/components/button
? What's component name? Button
// Now you can check these files.
// - src/components/button/index.js
// - src/components/button/Button.js
- scaff generate
- Error handling
- Support file type
- Improve dialog
- Add more commands
- Add more variables option that can be replaced