merge-yaml-cli
Advanced tools
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.* |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3005
13
1
1