npm.io
0.0.3 • Published 4 years agoCLI

deepmerge-yaml

Licence
MIT
Version
0.0.3
Deps
3
Size
12 kB
Vulns
0
Weekly
0
Stars
1

deepmerge-yaml

deep merge yaml files

Install

$ npm install -g deepmerge-yaml

Usage

stdio
$ npx deepmerge-yaml /path/to/some1.yaml /path/to/some2.yaml
write file
$ npx deepmerge-yaml -o /path/to/some1.yaml /path/to/some2.yaml /path/to/some3.yaml

Spec

import * as fs from 'fs';
import * as path from 'path';
import { deepmergeYaml } from 'deepmerge-yaml';

const a = fs.readFileSync(path.resolve(__dirname, './a.yaml')).toString().trim();
const b = fs.readFileSync(path.resolve(__dirname, './b.yaml')).toString().trim();
const output = fs.readFileSync(path.resolve(__dirname, './output.yaml')).toString().trim();

test('nested properties', () => {
  const result = deepmergeYaml(a, b).trim();

  expect(result).toBe(output);
});

Keywords