2.0.0 • Published 1 year ago

yaml-sort v2.0.0

Weekly downloads
1,125
License
MIT
Repository
github
Last release
1 year ago

Node.js CI npm version

About

yaml-sort sorts YAML files alphabetically.

This tool is basically a tiny wrapper around js-yaml.

(Inspired by yml-sorter)

Installation

npm install -g yaml-sort

Usage

Usage: yaml-sort [options]

Options:
  -i, --input         The YAML file(s) which needs to be sorted  [array] [default: "-"]
  -o, --output        The YAML file to output sorted content to  [string]
  -s, --stdout        Output the proposed sort to STDOUT only  [boolean]
  -k, --check         Check if the given file(s) is already sorted  [boolean]
      --indent, --id  Indentation width to use (in spaces)  [number] [default: 2]
  -e, --encoding      Input encoding  [choices: "ascii", "utf8", "utf16le"] [default: "utf8"]
  -q, --quotingStyle  Strings will be quoted using this quoting style  [choices: "single", "double"] [default: "single"]
  -w, --lineWidth     Wrap line width (-1 for unlimited width)  [number] [default: 80]
  -h, --help          Show help  [boolean]
      --version       Show version number  [boolean]

Examples:
  yaml-sort --input config.yml                                 Sorts alphabetically and overwrites the file config.yml
  yaml-sort --input config.yml --lineWidth 100 --stdout        Sorts the file config.yml and output result to STDOUT wrapped to 100 columns
  yaml-sort --input config.yml --indent 4 --output sorted.yml  Indents with 4 spaces and outputs result to file sorted.yml
  cat config.yml | yaml-sort                                   Sorts alphabetically from STDIN
2.0.0

1 year ago

1.2.0

2 years ago

1.1.1

2 years ago

1.2.1

2 years ago

1.1.0

3 years ago

1.0.6

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago