Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@alexlafroscia/yaml-merge

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alexlafroscia/yaml-merge

A super simple tool for merging YAML files

  • 4.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
13K
increased by5.45%
Maintainers
1
Weekly downloads
 
Created
Source

yaml-merge

Verify

A super simple tool for merging YAML files.

Installation

For the command line

npm install -g @alexlafroscia/yaml-merge

For use through Node

npm install --save @alexlafroscia/yaml-merge

Usage

yaml-merge takes a series of yaml files and merges them from left to right. This means that the first file will be overwritten by properties of the second, which is overwritten by properties of the third, etc.

Command Line

When using this tool from the command line, the output file will simply be written to STDOUT

yaml-merge test/fixtures/basic/a.yml test/fixtures/basic/b.yml
a:
  foo: bar
b:
  foo: bar

This way, you can pipe the output to whatever you want. For example, this will write the new yaml file to output.yml

yaml-merge test/fixtures/basic/a.yml test/fixtures/basic/b.yml > output.yml

The provided file names will be resolved relative to the current directory. So, you an provide a relative path to the files, or an absolute path -- either method works just fine.

As a Node package

yaml-merge also provides a node package that can be consumed to get the output file programmatically.

const resolve = require('path').resolve;
const merge = require('@alexlafroscia/yaml-merge');

const output = merge(resolve('relative/path/to/file.yml'), '/Users/you/some/other/file.yml');
console.log(output); // Prints out the resulting YAML as a string

FAQs

Package last updated on 25 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc