Code Monkey home page Code Monkey logo

v-yaml2json's Introduction

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] [<yaml-file>]

Options:
  -o|--output <file>    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 exit

If 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.

v-yaml2json's People

Contributors

github-actions[bot] avatar prantlf avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.