# file_cracker

> Flexible file batch package, template supported.

Latest version **1.0.8** (published 2019-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install file_cracker
pnpm add file_cracker
yarn add file_cracker
bun add file_cracker
```

Provides the command `file_cracker`.

## 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.8 |
| Published | 2019-12-06 |
| First published | 2019-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | elss-zion |
| Maintainers | elss-zion |
| Keywords | file, batch |

## Links

- npm: https://www.npmjs.com/package/file_cracker
- Repository: https://github.com/ELSS-ZION/file_cracker-for-node
- Homepage: https://github.com/ELSS-ZION/file_cracker-for-node#readme
- Issues: https://github.com/ELSS-ZION/file_cracker-for-node/issues
- npm.io page: https://npm.io/package/file_cracker

## 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.8 (latest) — 2019-12-06
- 1.0.7 — 2019-12-06
- 1.0.6 — 2019-12-02
- 1.0.5 — 2019-12-02
- 1.0.4 — 2019-11-29
- 1.0.3 — 2019-11-29
- 1.0.2 — 2019-11-29
- 1.0.1 — 2019-11-29
- 1.0.0 — 2019-11-29

## README

# file_cracker

Flexible file batch package, template supported.

---
## Installation

```bash
$ npm i -g file_cracker
```
---
## Usage

### Create File

- if file already exists, won't do anything

- if you want to create a directory, please `filename` ends with '/'

config.json

```json
[
    "aaa/bbb/",
    "ccc/1.txt",
    "2.txt"
]
```

command

```bash
$ file_crack config.json
```

output

```bash
file created: 2.txt
file created: ccc/1.txt
directory created: aaa/bbb/
```

### Specifies Filename `With Command Line Parameters`

- {%`digit`%} specifies command line parameter

config.json

```json
[
    "aaa/{%1%}/",
    "{%2%}/x{%3%}y.txt"
]
```

command

```bash
$ file_cracker config.json aaa bbb ccc
```

output

```bash
create file: bbb/xcccy.txt
create directory: aaa/aaa/
```

### Create File `With Template`

config.json

```json
{
    "1.txt": {
        "template": "template.txt"
    }
}
```

template.txt

```
xxx
```

command

```bash
$ file_cracker config.json
```

output

```bash
create file: 1.txt      from template: template.txt
```

generated file

```
xxx
```

### Render `Template` To File

config.json

```json
{
    "1.txt": {
        "template": "template.txt",
        "dict": {
            "v1": "value1",
            "v2": "value2"
        }
    }
}
```

template.txt

```
xxx
{%1%}
{%2%}
{%3%}
{%v1%}
{%v2%}
```

command

```bash
$ file_cracker config.json aaa bbb ccc
```

output

```bash
create file: 1.txt      from template: template.txt
```

generated file

```
xxx
aaa
bbb
ccc
value1
value2
```

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