Liu Song’s Projects


~/Projects/create-z

git clone https://code.lsong.org/create-z

create-z

Universal Project Scaffold Tools

/ˈkreɪzi/

Install

~$ npm i -g create-z

How to use?

First, create template files in your project:

~$ mkdir -p templates/page
~$ echo "hello world" >> templates/page/index.js.hbs

Then,

~$ create-z page
[O] ~/Projects/my-project/index.js

You will see them ...

~$ cat ~/Projects/my-project/index.js
hello world

Ask Questions

~$ $EDITOR templates/page/index.js.hbs
+ ---
+ questions:
+   - type: input
+     name: name
+     message: Please input your page name:
+ ---
- hello world
+ hello {{{name}}}
~$ create-z page
Please input your page name: mypage
[O] ~/Projects/my-project/index.js

Then ...

~$ cat ~/Projects/my-project/index.js
hello mypage