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

mermal

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mermal

Merges YAML files whilst following JSON references

  • 0.1.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status Maintainability Greenkeeper badge Known Vulnerabilities

Merges one or more YAML files into a base file.

Usage

mermal is available on NPM.

NPM

mermal provides an API as well as a CLI.

Install

# Locally
$ yarn add mermal   # Using yarn
$ npm install mermal    # Using npm

# Or globally
$ yarn global add mermal   # Using yarn
$ npm install -g mermal    # Using npm

API

All API methods returns with a promise.

Example
import * as merge from 'mermal';

const base = `a:
  b1: b1
  b2: b2`;

const override = `a:
  b1: b3
c:
  d1: d1`;

merge.toYaml(base, override)
  .then(console.log);

/**
 * Log will read:
    a:
      b1: b3
      b2: b2
    c:
      d1: d1
 */

Available Methods
toFile
toJson
toYaml

CLI

Example
$ mermal -b base.yaml -s sub/ -o out.yaml
Options
-b, --base <baseFile>     Path to the base YAML file where other files will be merged into
-o, --out <outFile>       Path to the YAML file that will be exported to. It will override any existing files
-s, --search <searchDir>  A directory that will be searched for
-h, --help                output usage information

See mermal --help for more options.

Comparison with other packages

  • merge-yaml
    • Lacks extensive testing
    • Throws error if the file could not be found
    • Must specify the path of every file
  • swagger-yaml
    • Not available as a CLI
    • Opinionated about where you place your source files

TODO

  • Improve Tests
  • More tests
  • Handle edge cases

Keywords

FAQs

Package last updated on 09 May 2018

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