# @janiscommerce/yml-builder

> A package for build a single yml file from multiple source files.

Latest version **2.0.2** (published 2019-11-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @janiscommerce/yml-builder
pnpm add @janiscommerce/yml-builder
yarn add @janiscommerce/yml-builder
bun add @janiscommerce/yml-builder
```

Provides the command `yml-builder`.

## 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 | 2.0.2 |
| Published | 2019-11-13 |
| First published | 2019-09-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Janis |
| Maintainers | janiscommerce |

## Links

- npm: https://www.npmjs.com/package/@janiscommerce/yml-builder
- Repository: https://github.com/janis-commerce/yml-builder
- Homepage: https://github.com/janis-commerce/yml-builder.git#readme
- Issues: https://github.com/janis-commerce/yml-builder/issues
- npm.io page: https://npm.io/package/@janiscommerce/yml-builder

## Dependencies (6)

- [yaml](https://npm.io/package/yaml.md) ^1.7.0
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [lllog](https://npm.io/package/lllog.md) ^1.1.2
- [yargs](https://npm.io/package/yargs.md) ^14.0.0
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.2
- [recursive-readdir](https://npm.io/package/recursive-readdir.md) ^2.2.2

## Recent versions

- 2.0.2 (latest) — 2019-11-13
- 2.0.1 — 2019-10-17
- 2.0.0 — 2019-10-01
- 1.1.0 — 2019-09-30
- 1.0.0 — 2019-09-27

## README

# yml-builder

[![Build Status](https://travis-ci.org/janis-commerce/yml-builder.svg?branch=master)](https://travis-ci.org/janis-commerce/yml-builder)
[![Coverage Status](https://coveralls.io/repos/github/janis-commerce/yml-builder/badge.svg?branch=master)](https://coveralls.io/github/janis-commerce/yml-builder?branch=master)

A package for build a single yml file from multiple source files.

## Installation
```sh
npm install @janiscommerce/yml-builder
```

## Usage (command line)
```sh
npx @janiscommerce/yml-builder -i sourceDir -o outputFile.yml
```

### Important:
- **The source files must be `.yml` or `.yaml` any other file types will be skipped.**
- **The input path and output file path starts from the current working directory.**
- **The output file will be replaced if it exists.**
- **The output directory will be recursively created if not exists.**
- **If there is not any source files in the specified input directory or not exists, an empty file will be generated.**

### Options:
```sh
--input, -i   the path to your sources directory
--output, -o  the path to the file that will be generated
```

## Examples

```sh
npx @janiscommerce/yml-builder -i permissions/src -o permissions/permissions.yml

# Will get the source files from /path/to/root/permissions/src
# Will generate the output file into /path/to/root/permissions/permissions.yml
```

## Usage (as module)
```js
const YmlBuilder = require('@janiscommerce/yml-builder');
```

## API

### **`new YmlBuilder(input, output)`**

Constructs the YmlBuilder instance, configuring the `input [String]` and `output [String]` path.

### **`async execute(input, output)`**

Builds the ymls from the input path into the output file path.
Optionally you can specify the `input [String]` and `output [String]` path, by default it will be obtained from the constructor config.

## Examples

```js
const YmlBuilder = require('@janiscommerce/yml-builder');

const ymlBuilder = new YmlBuilder('input-dir', 'output-file.yml');

(async () => {

	await ymlBuilder.execute(); // It will run the build process...

})();
```

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