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

merge-yaml-cli

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merge-yaml-cli - npm Package Compare versions

Comparing version 1.0.1 to 1.0.3

34

index.js
#!/usr/bin/env node
var fs = require('fs');
var os = require('os');
var glob = require('glob');
var mergeYaml = require('merge-yaml');
var jsYaml = require('js-yaml');
const fs = require('fs')
const os = require('os')
const glob = require('glob')
const mergeYaml = require('merge-yaml')
const jsYaml = require('js-yaml')
var args = require('yargs')
const args = require('yargs')
.usage('Usage: $0 <options>')
.example('$0 -i "one.yml two/*.yml" -o out.yml')
.example('$0 -i one.yml two/*.yml -o out.yml')
.array('i')

@@ -21,16 +21,16 @@ .alias('i', 'inputs')

.strict()
.argv;
.argv
var files = [].concat.apply([], args.inputs.map(g => glob.sync(g, {nodir: true})))
const files = [].concat.apply([], args.inputs.map(g => glob.sync(g, {nodir: true})))
console.log('Merging files:');
console.log(files.join(os.EOL), os.EOL);
console.log('Merging files:')
console.log(files.join(os.EOL), os.EOL)
var swagger = mergeYaml(files);
const swagger = mergeYaml(files)
console.log('Writing:');
console.log(args.output);
fs.writeFileSync(args.output, jsYaml.safeDump(swagger));
console.log('Writing:')
console.log(args.output)
fs.writeFileSync(args.output, jsYaml.safeDump(swagger))
console.log(os.EOL);
console.log('Finished merge!');
console.log(os.EOL)
console.log('Finished merge!')
{
"name": "merge-yaml-cli",
"version": "1.0.1",
"version": "1.0.3",
"description": "CLI utility for merging YAML files",

@@ -17,3 +17,10 @@ "bin": {

},
"repository": {
"type": "git",
"url": "https://github.com/brainsiq/merge-yaml-cli.git"
},
"license": "MIT",
"scripts": {
"test": "standard"
},
"dependencies": {

@@ -24,3 +31,6 @@ "glob": "^7.1.0",

"yargs": "^6.0.0"
},
"devDependencies": {
"standard": "^8.3.0"
}
}
# merge-yaml-cli
[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
A simple CLI wrapper around [merge-yaml](https://www.npmjs.com/package/merge-yaml) using [glob](https://www.npmjs.com/package/glob) patterns to specify input files.

@@ -9,4 +11,3 @@

npm i -g merge-yaml-cli
merge-yaml -i "example.yaml includes/*.yml" -o merged.yml
merge-yaml -i example.yaml includes/*.yml -o merged.yml
```
*Note: don't forget the quotes, otherwise your shell may expand wildcard paths.*
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