0.1.0 • Published 7 years ago

xod-yaml-tools v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

xod-yaml-tools

A collection of YAML tools for XOD project.

Installation

yarn add --dev xod-yaml-tools

Usage

xod-yaml-tools:normalize

This tool normalizes .yaml file:

  • sorts objects' keys lexicographically;
  • encloses string literals in quotes, if needed;
  • strips quotes from string literals, if needed;
  • replaces long string literals with multi-line, if needed;
  • replaces multi-line with short string literals, if needed.

Normalize a single .yaml file:

./node_modules/.bin/xod-yaml-tools:normalize api/swagger/swagger.yaml

Normalize all .yaml files in a directory:

find . -name *.yaml -exec ./node_modules/.bin/xod-yaml-tools:normalize {} \;

xod-yaml-tools:synchronize

This tool synchronizes package.json leader file with swagger.yaml follower file:

package.jsonswagger.yaml
/author/info/contact
/description/info/description
/name/info/title
/version/info/version

Synchronize:

./node_modules/.bin/xod-yaml-tools:synchronize package.json  \
 api/swagger/swagger.yaml
0.1.0

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago