# template-touch-file

> Create prefix comment template file.

Latest version **1.0.3** (published 2020-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install template-touch-file
pnpm add template-touch-file
yarn add template-touch-file
bun add template-touch-file
```

Provides the command `tf`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-07-14 |
| First published | 2020-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | tree-some |
| Maintainers | tree-some |
| Keywords | template, comment, touch, create, file |

## Links

- npm: https://www.npmjs.com/package/template-touch-file
- npm.io page: https://npm.io/package/template-touch-file

## 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.3 (latest) — 2020-07-14
- 1.0.2 — 2020-07-13
- 1.0.1 — 2020-07-13
- 1.0.0 — 2020-07-13

## README

# template-touch-file

This can be used in place of `touch` command.
When create new source file, you can create new file with your prefix template.

## Install

```sh
npm install -g template-touch-file
```

## Usage

```sh
$ tf
Usage: tf [options...] [file]
       file:   target file path

Options
  --author               Who are author? [default: (from git config)]
  --email                What is author's email? [default: (from git config)]
  --license              File license [default: MIT]
```

```sh
tf --author=tree-some path/to/file.js
```

## Config

`.tsrc` must be exist your project source root directory.

ex) It should be in the same directory as package.json.

```json
{
	"author": "tree-some",
	"email": "youn@tree-some.dev",
	"license": "MIT"
}
```

It need not be included unconditionally.

```json
{
	"author": "tree-some"
}
```

## Custom Template

You can create template specific files as `$HOME/tf` directory.
File name form is `tf.[ext]`.

ex) `tf.js` is for `*.js` file template.

`tf.default` is for an unknown format.

Default templates can be found [here](https://github.com/tree-some/template-touch-file/tree/master/tf).

## Prefix Variable

When you create template file, can use some variable.

Variable can use `{{#var}}`. And don't care case.

### Author

Author of the file. Use `{{author}}`. Default) `git config --global user.name`.

### Email

Author email of the file. Use `{{email}}`, Default) `git config --global user.email`.

### License

File (Project) license. Use `{{license}}`, Default) `MIT`.

### Date

The date the file was created. `new Date().toDateString()`.

### File

File name. Use `{{file}}`.

### Path

The directory where the file exists. Use `{{path}}`.

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