drbild / json2yaml Goto Github PK
View Code? Open in Web Editor NEWConvert JSON to YAML or vice versa, while preserving the order of associative arrays.
License: Apache License 2.0
Convert JSON to YAML or vice versa, while preserving the order of associative arrays.
License: Apache License 2.0
/feature
The output file argument should be prepended with -o |--output and the tool should accept as many intput files as defined.
The usage will be e.g.
yaml2json [-i <indent>] [-a] [-f] [<yaml_file>, <yaml_file>...] [-o <json_file>]
The output will be json stream
For the json2yaml the output will be yaml multidocument
Hi,
I see your json2yaml and is a great tool.
When use a big json file, and covert into a yaml file, write all in each line, the is difficult read without a separator.
An example is:
test1:
......
......
test2:
......
......
.....
Exist a option or workaround to generate the first level with a empty line?
Example:
test1:
......
......
test2:
......
......
.....
Regards
When second argument defined and file exists, the tool overwrite the target file.
IMHO the output should be prepended with -o |--output argument and the tool should accept as many intput files as defined, but is would be a feature request.
If using the indent
option to json.dump
the separators
argument should be set to (',',': ')
(i.e. set the item separator to not contain a space). Without this change the conversion leaves lines with trailing whitespace which causes some editors and VCS to complain.
The json.dump
function also doesn't terminate the last line with a newline character which should be added.
As a feature request I would like the indent to default to 2 instead of 4 to make it match the indentation of the yaml files, or else have it as a command line option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.