Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14, 16, 18, 20, 22]
node-version: [20, 22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: latest
Expand All @@ -23,8 +23,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: latest
registry-url: https://registry.npmjs.org/
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Options:
--indent, --id Indentation width (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"]
-f, --forceQuotes Force quotes for all scalar values [boolean] [default: false]
-f, --forceQuotes Force quotes around all strings [boolean]
-w, --lineWidth Wrap line width (-1 for unlimited width) [number] [default: 80]
-h, --help Show help [boolean]
--version Show version number [boolean]
Expand All @@ -35,6 +35,5 @@ 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
yaml-sort --input config.yml --forceQuotes --quotingStyle double Forces double quotes for all scalar values
cat config.yml | yaml-sort Sorts alphabetically from STDIN
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"homepage": "https://github.com/ddebin/yaml-sort#readme",
"dependencies": {
"js-yaml": "^4.0.0",
"yargs": "^17.0.0"
"yargs": "^18.0.0"
},
"devDependencies": {
"standard": "^17.0.0",
"tape": "^5.6.6",
"tape-spawn": "^1.4.2"
},
"engines": {
"node": ">=12"
"node": ">=20"
}
}
5 changes: 3 additions & 2 deletions yaml-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
const fs = require('fs')
const yaml = require('js-yaml')
const yargs = require('yargs')
const { hideBin } = require('yargs/helpers')

const argv = yargs
const argv = yargs(hideBin(process.argv))
.usage('Usage: $0 [options]')
.example([
['$0 --input config.yml',
Expand Down Expand Up @@ -79,7 +80,7 @@ const argv = yargs
.alias('h', 'help')
.version()
.wrap(null)
.argv
.parse()

let success = true

Expand Down