Zuzu
Aa small utility that helps generate files from a template. Just something like angular-cli ng generate component but not focused on any framework.
Install / Use
/learn @gndplayground/ZuzuREADME
zuzu
zuzu is a small utility that helps generate files from a template. Just something like angular-cli ng generate component but not focused on any framework.
Install
npm install --save-dev zuzu
yarn add --dev zuzu
Usage
npx zuzu name
By the default the CLI will look for the template folder in the current calling directory and copy the content of that folder to the name was inputted.
node_modules
template
├──── file.js
name
├──── file.js
-base-template
We can change the default template location by using -base-template arg.
npx zuzu -base-template=custom/location name
-t
If the template location has multiple directories and we want to select a specific folder we can use -t arg.
npx zuzu -t=cat name
node_modules
template
├──── cat
├──── cat.js
├──── dog
├──── dog.js
name
├──── cat.js
-no-dir
If we do not want to create the directory in the current calling location we can use -no-dir arg.
npx zuzu -no-dir name
node_modules
template
├──── file.js
file.js
-dir
We can change the output directory location using-dir arg
npx zuzu -dir=hello name
node_modules
template
├──── file.js
hello
├──── name
├──── file.js
Variable
The CLI support name variable.
npx zuzu hello
In the above cmd, the name variable is "hello". We can replace text content or file name in the selected template folder by using the name variable.
- {{name}} => replace to current name.
- {{nameCamel}} => replace to lower camel case
- {{NameCamel}} => replace to camel case
- {{nameKebab}} => replace to kebab case
- {{NameKebab}} => replace to screaming kebab case.
- {{Name}} => replace to title case.
- {{NAME}} => replace to upper case.
Example
npx zuzu hello-world
node_modules
template
├──── {{NameCamel}}.js
hello-world
├──── HelloWorld.js
Content {{NameCamel}}.js file
import React, {FunctionComponent} from 'react';
const {{NameCamel}}: FunctionComponent = () => {
return (
<h1>Hello!</h1>
);
};
export default {{NameCamel}};
Content HelloWorld.js file
import React, {FunctionComponent} from 'react';
const HelloWorld: FunctionComponent = () => {
return (
<h1>Hello!</h1>
);
};
export default HelloWorld;
Related Skills
node-connect
354.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
