# templater-cli

> CLI for creating files by templates

Latest version **1.0.6** (published 2023-10-02) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install templater-cli
pnpm add templater-cli
yarn add templater-cli
bun add templater-cli
```

Provides the command `templater`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-10-02 |
| First published | 2023-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ch4m4 |
| Maintainers | ch4m4 |
| Keywords | cli, templater, template, templates, file, files, create, generate, generator |

## Links

- npm: https://www.npmjs.com/package/templater-cli
- Repository: https://github.com/ch4m4/templater-cli
- Homepage: https://github.com/ch4m4/templater-cli#readme
- Issues: https://github.com/ch4m4/templater-cli/issues
- npm.io page: https://npm.io/package/templater-cli

## Dependencies (2)

- [inquirer](https://npm.io/package/inquirer.md) ^9.1.4
- [commander](https://npm.io/package/commander.md) ^10.0.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.6 (latest) — 2023-10-02
- 1.0.5 — 2023-04-06
- 1.0.4 — 2023-04-03
- 1.0.3 — 2023-04-03
- 1.0.2 — 2023-04-02
- 1.0.1 — 2023-04-02
- 1.0.0 — 2023-03-29
- 0.1.0 — 2023-03-29

## README

# Templater CLI
Templater is a simple command line tool for managing and generating files from templates.

## Installation
```bash
npm install templater-cli --save-dev
```

## Usage
```bash
templater <command> [options]
```

## Commands
- `add` | `a` \<templateName> - add a new template
- `create` | `c` \<templateName> - create files from template
- `init` | `i` - initialize configuration file
- `list` | `l` - show all templates
- `remove` | `r` \<templateName> - remove a template

## Options
- `--config` | `-c` \<path> - specify the config file (default: templater.json)
- `--output` | `-o` \<path> - specify the output directory (only for create command)

## Config file
```json
{
  "templatesPath": "./templates",
  "filesCase": "kebab",
  "templates": [
    {
      "name": "ui",
      "description": "ui components",
      "templatePath": "./ui",
      "outputPath": "./src/shared/ui",
      "replaceRules": [
        {
          "keyword": "__name__",
          "case": "pascal"
        }
      ]
    }
  ]
}
```
- `templatesPath` - path to templates directory (default: ./templates)
- `filesCase` - case of the generated files
- `templates` - templates rules array:
    - `name` - template name
    - `description` - template description
    - `templatePath` - path to template directory
    - `outputPath` - path to output directory
    - `replaceRules` - replace rules array:
        - `keyword` - keyword to replace
        - `case` - case of the keyword

### Available cases
- `camel` - camelCase
- `kebab` - kebab-case
- `pascal` - PascalCase
- `snake` - snake_case
- `upper` - UPPER_CASE
- `lower` - lowercase

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