# @dovicsin/bulk-file-creator

> Create bulk file from table (supported: xlsx,xls,ods)

Latest version **1.0.3** (published 2023-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dovicsin/bulk-file-creator
pnpm add @dovicsin/bulk-file-creator
yarn add @dovicsin/bulk-file-creator
bun add @dovicsin/bulk-file-creator
```

Provides the command `bulk-file-creator`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-06-07 |
| First published | 2023-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tamas Dovicsin |
| Maintainers | dovicsin |
| Keywords | files creator, xlsx |

## Links

- npm: https://www.npmjs.com/package/@dovicsin/bulk-file-creator
- Repository: https://github.com/dovicsin/bulk-file-creator
- Homepage: https://github.com/dovicsin/bulk-file-creator#readme
- Issues: https://github.com/dovicsin/bulk-file-creator/issues
- npm.io page: https://npm.io/package/@dovicsin/bulk-file-creator

## Dependencies (2)

- [yargs](https://npm.io/package/yargs.md) ^17.7.2
- [convert-excel-to-json](https://npm.io/package/convert-excel-to-json.md) ^1.7.0

## Recent versions

- 1.0.3 (latest) — 2023-06-07
- 1.0.1 — 2023-06-06
- 1.0.0 — 2023-06-06

## README

# Bulk file creator

Create bulk files with or without structured directories. Be it a configuration file or a plain text file. 

The source should be a plain table that contains the header and beyond that each row will be a separate file. Just parameterize it with the appropriate flags and you're ready with lots of new files.

## Install

```sh
npm install --global @dovicsin/bulk-file-creator
```

## Usage

```sh
bulk-file-creator -s source.xlsx
```

## Flags

| Name | Flag | Short | Default | Required | Description |
|------|------|-------|---------|----------|-------------|
| Source file | --source | -s | None | true | Source file (supported: xlsx, xls, ods) |
| Target directory | --target | -t | dist/ | false | Target directory when saved all file |
| Create dirs | --dirs | -d | true | false | Create directory every files |
| Add header | --addheaderkey | -a | true | false | Add header key in content with join separator |
| Join | --join | -j | = | false | The target file content line and header separator |

## Source format headers

- `name` - First column contained the file names
- `extension` - Second column contained all file extension (not required)
- Every other column contained file content. The first row value is a line parameter name.

## Example source (sheet-1)
| name | extension | TITLE | DESCRIPTION | DATE | ETC |
|------|-----------|-------|-------------|------|-----|
| file-1 | txt | First title | Description value | 2023 | etc parameters |
| file-2 | txt | Second title | Description value | 2020 | other |
| file-3 | pdf | Pdf title | Pdf  desc | 2024 | ... |

## Result 
```sh
bulk-file-creator -s source.xlsx
```
```
dist
  sheet-1
    file-1
      file-1.txt
    file-2
      file-2.txt
    file-3
      file-3.txt
```

**Without plus dirs**
```sh
bulk-file-creator -s source.xlsx -d false
```
```
dist
  sheet-1
    file-1.txt
    file-2.txt
    file-3.txt
```

### file-1.txt
```
TITLE=First title
DESCRIPTION=Description value
DATE=2023
ETC=etc parameters
```

## Example simple content

```sh
bulk-file-creator -s source.xlsx -a false
```

| name | extension | CONTENT |
|------|-----------|---------|
| file-1 | txt | First content \n more lines |
| file-2 | txt | Sec content |
| file-3 | txt | Content |

**file-1 final content**
```text
First content
more lines
```

## Supported source extensions

- xlsx
- xls
- ods

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