@tonyer/cg
v0.0.35
Published
A fast text/code generator
Downloads
38
Readme
cg
a text tool that saves you time and helps your team build new files with consistency.
Install
- Download from release
- Install by
npm
npm i -g @tonyer/cg# other package manager
yarn add -g @tonyer/cg
pnpm add -g @tonyer/cgQuick Start
- Add
template
cd examples
# add a template to user path
cg add base
# as new name
cg add base test- Use
Template name
# use template to generate
cg g base --name Tom --age 12
cg g test --name Job --age 44- Use
Template path
# use template to generate
cg g --template=examples/base --params="name=Tom&age=12"
cg g --template=examples/test --params="name=Tom&age=12"Use git
- Add
templaterepo
# clone template repo
cg clone https://github.com/MQpeng/cg-templates- fetch
templaterepo
# pull template repo
cg pull