# @mengxun/quick-template

> create template for my self quickly

Latest version **0.0.10** (published 2023-02-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @mengxun/quick-template
pnpm add @mengxun/quick-template
yarn add @mengxun/quick-template
bun add @mengxun/quick-template
```

Provides the command `qt`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2023-02-16 |
| First published | 2023-02-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | mengxun |
| Maintainers | mengxun |
| Keywords | template, quick template, git |

## Links

- npm: https://www.npmjs.com/package/@mengxun/quick-template
- Repository: https://github.com/mengxun1437/quick-template
- Homepage: https://github.com/mengxun1437/quick-template#readme
- Issues: https://github.com/mengxun1437/quick-template/issues
- npm.io page: https://npm.io/package/@mengxun/quick-template

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [rimraf](https://npm.io/package/rimraf.md) ^4.1.2
- [inquirer](https://npm.io/package/inquirer.md) ^8.2.5
- [commander](https://npm.io/package/commander.md) ^10.0.0
- [download-git-repo](https://npm.io/package/download-git-repo.md) ^3.0.2

## Recent versions

- 0.0.10 (latest) — 2023-02-16
- 0.0.9 — 2023-02-16
- 0.0.8 — 2023-02-16
- 0.0.7 — 2023-02-16
- 0.0.6 — 2023-02-16
- 0.0.5 — 2023-02-16
- 0.0.4 — 2023-02-16
- 0.0.3 — 2023-02-16
- 0.0.2 — 2023-02-15
- 0.0.1 — 2023-02-15

## README

# quick-template
my own quick template

## Install
- `npm install @mengxun/quick-template -g`

## How to Use?
You should to set your own git storage of your templates, every template should be stored on each branch, the branch's name is same as the template's name

And then, you can use the command like this to set your git config
```shell
qt config git.type -u <your plat name e.g. github>

qt config git.origin -u <your host name, e.g. https://github.com>

qt config git.owner -u <your user name e.g. mengxun1437>

qt config git.name -u <your repository's name e.g. quick-template>
```


After that, you can use the command like this to set the templates you have
```shell
qt config templates -a <the name of branch your used to store template e.g. nodejs>

# change the -a to -d, then you can delete the template
```

You can also opt like this to set some global props
```shell
qt config globalProps -a <global props e.g. projectName/projectDescription>

qt config handleFiles -a <handle files e.g. package.json/README.md>

# the cli will find the path from handleFiles and then find the globalProps in these files to replace them

```

NOTE: You should set global props like this 👇

```json
{
  "name": "${projectName}",
  "version": "1.0.0",
  "description": "${projectDescription}",
}
```
this will be transformed to
```json
{
  "name": "<projectName>",
  "version": "1.0.0",
  "description": "<projectDescription>",
}
```


After that, you can opt like above to set if some Commands need show
```shell

qt config extraCommands.<template name e.g. nodejs> -a <extra command e.g. repoAuthor>

```
And then, when you use init, the cli will ask you the command


At last, you can use like `qt config git.name` to check your config
Also you can find the `.quick-template` file in your system, and modify it to change the config
And you can also use `qt edit config` to change


## Usage

`qt init` is a quick command for you to choice the template of your own, incase every time you create a new project with complex options

## Other
here is the default config in this cli 
```json
{
    "git": {
        "type": "github",
        "origin": "https://github.com",
        "owner": "mengxun1437",
        "name": "quick-template"
    },
    "globalProps": [
        "projectName",
        "projectDescription",
        "projectAuthor"
    ],
    "templates": [
        "nodejs-cli"
    ],
    "handleFiles": [
        "package.json",
        "README.md"
    ],
    "extraCommands": {
        "nodejs-cli": [
            "repoAuthor",
            "command"
        ]
    }
}
```

you can see this https://github.com/mengxun1437/quick-template/tree/nodejs-cli to check my nodejs-cli template

---
_Source: https://npm.io/package/@mengxun/quick-template · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
