# resolve-yaml

> Merge yaml files and resolve relative file paths

Latest version **1.0.0** (published 2017-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install resolve-yaml
pnpm add resolve-yaml
yarn add resolve-yaml
bun add resolve-yaml
```

Provides the command `resolve-yaml`.

## 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.0 |
| Published | 2017-09-01 |
| First published | 2017-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Benjamin Karran |
| Maintainers | ebekebe |

## Links

- npm: https://www.npmjs.com/package/resolve-yaml
- npm.io page: https://npm.io/package/resolve-yaml

## Dependencies (2)

- [js-yaml](https://npm.io/package/js-yaml.md) ^3.9.1
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.0

## Recent versions

- 1.0.0 (latest) — 2017-09-01

## README

# Merge YAML files and resolve relative file paths

I needed a tool to merge docker-compose files.
`docker-compose config` was ill suited, because it skips unsupported options
like `deploy` that are only used by `docker stack deploy`.

In contrast to existing tools like [merge-yaml](https://github.com/skapoor/merge-yaml)
this tool transforms relative paths, so the paths are still valid in the merged
file. Every string element that starts with `./` is considered a path and is
transformed relative to the current working directory.


## Installation

`npm install -g resolve-yaml`


## Usage

`resolve-yaml file1.yaml file2.yaml [...] >out.yaml`


## Example

`resolve-yaml dir1/docker-compose.yml dir2/docker-compose.yaml >out.yaml`


**dir1/docker-compose.yml**

```yaml
version: '3'
services:
  serviceA:
    build: ./
```

**dir2/docker-compose.yml**

```yaml
version: '3'
services:
  serviceB:
    build: ./subdirectory
```

**out.yml**

```yaml
version: '3'
services:
  serviceA:
    build: ./dir1

  serviceB:
    build: ./dir2/subdirectory
```

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