Easy-to-use JSON <=> YAML converter
Input format is detected automatically, hence:
# The classic way:
jaml <file.yaml|url-to-yaml-contents>
# or using piped standard input:
cat file.yaml | jaml
# The classic way:
jaml <file.json|url-to-json-contents>
# or using piped standard input:
cat file.json | jaml
Converting remote JSON contents over https
jaml https://repo.packagist.org/packages/list.json?vendor=yannoff
Output:
packageNames:
- yannoff/collections
- yannoff/composer-dotenv-handler
- yannoff/console
- yannoff/handyman
- yannoff/lumiere-ui
- yannoff/lumiere-utils
- yannoff/symfony-boilerplate
- yannoff/y-a-m-l
- yannoff/yamltools
Converting a YAML file contents
jaml composer.yaml
Output:
{
"name": "yannoff/jaml",
"description": "Easy-to-use JSON <=> YAML converter",
"type": "project",
"license": "MIT",
"authors": [
{
"name": "Yannoff",
"homepage": "https://github.com/yannoff"
}
],
"autoload": {
"psr-4": {
"Yannoff\\Jaml\\": "src/"
}
},
"require": {
"yannoff/console": "^2.0",
"yannoff/yamltools": "^1.5"
}
}
-i, --interactive
Run in interactive mode
-h, --help
Display help message
-v, --verbose
Increase the verbosity of jaml output
--version
Display version and exit
Get the latest release and install it
curl -Lo /usr/bin/jaml https://github.com/yannoff/jaml/releases/latest/download/jaml
chmod +x /usr/bin/jaml
💡 The /usr/bin/jaml
path is just an example, fell free to replace by any custom binary file path.
Some checksum files are available to verify the jaml
binary integrity:
Here is an example using PHP
echo hash_file('sha384', 'https://github.com/yannoff/jaml/releases/latest/download/jaml');
JAML leverages offenbach for PHP dependency management.
Compiled as a PHAR self-executable using PHP Code Compiler.
Licensed under the MIT License.