Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prantlf/v-yaml2json
Converts YAML input to JSON/JSON5 output.
https://github.com/prantlf/v-yaml2json
convert json json5 jsonc vlang vlang-package yaml yaml2json
Last synced: 17 days ago
JSON representation
Converts YAML input to JSON/JSON5 output.
- Host: GitHub
- URL: https://github.com/prantlf/v-yaml2json
- Owner: prantlf
- License: mit
- Created: 2023-06-09T07:43:50.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-11-16T04:32:34.000Z (about 1 month ago)
- Last Synced: 2024-11-16T05:24:10.686Z (about 1 month ago)
- Topics: convert, json, json5, jsonc, vlang, vlang-package, yaml, yaml2json
- Language: V
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# yaml2json
Converts [YAML] input to [JSON]/[JSON5] output.
Uses [prantlf.json] and [prantlf.yaml]. See also the [jsonlint] tool.
## Synopsis
Convert a file `config.yaml` to a file `config.json`, append a trailing line break to the JSON output and make the output more readable by indentation:
yaml2json config.yaml -o config.json -lp
Convert a file using standard input and standard output, as condensed as possible, no trailing line break:
cat config.yaml | yaml2json > config.json
## Usage
yaml2json [options] []
Options:
-o|--output write the JSON output to a file
-t|--trailing-commas insert trailing commas to arrays and objects
-s|--single-quotes format single-quoted instead of double-quoted strings
--escape-slashes escape slashes by by prefixing them with a backslash
--escape-unicode escape multibyte Unicode characters with \u literals
-l|--line-break append a line break to the JSON output
-p|--pretty print the JSON output with line breaks and indented
-V|--version print the version of the executable and exit
-h|--help print th usage information and exitIf no input file is specified, it will be read from standard input.
## Build
v -prod yaml2json.v
v fmt -w .
v vet .
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Lint and test your code.
## License
Copyright (c) 2023-2024 Ferdinand Prantl
Licensed under the MIT license.
[prantlf.json]: https://github.com/prantlf/v-json
[prantlf.yaml]: https://github.com/prantlf/v-yaml
[jsonlint]: https://github.com/prantlf/v-jsonlint
[JSON]: https://www.json.org/
[JSON5]: https://spec.json5.org/
[YAML]: https://yaml.org/