-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.tpl
146 lines (100 loc) · 3.02 KB
/
README.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# JAML
Easy-to-use JSON <=> YAML converter
[](https://github.com/yannoff/jaml/releases/latest "Latest stable release")
[](https://github.com/yannoff/jaml/blob/master/LICENSE "MIT License")
## Usage
_Input format is detected automatically, hence:_
- [YAML input will be converted to JSON](#converting-yaml-to-json)
- [JSON input will be converted to YAML](#converting-json-to-yaml)
### Converting YAML to JSON
```bash
# The classic way:
jaml <file.yaml|url-to-yaml-contents>
# or using piped standard input:
cat file.yaml | jaml
```
### Converting JSON to YAML
```bash
# The classic way:
jaml <file.json|url-to-json-contents>
# or using piped standard input:
cat file.json | jaml
```
### Examples
_**Converting remote JSON contents over https**_
```bash
jaml https://repo.packagist.org/packages/list.json?vendor=yannoff
```
_Output:_
```yaml
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**_
```bash
jaml composer.yaml
```
_Output:_
```json
{
"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"
}
}
```
### Available options
**`-i, --interactive`**
*Run in interactive mode*
**`-h, --help`**
*Display help message*
**`-v, --verbose`**
*Increase the verbosity of jaml output*
**`--version`**
*Display version and exit*
## Installation
### Requirements
- [`php`](https://www.php.net/) 5.5+ or [`PAW`](https://github.com/yannoff/p-a-w)
### Quick install
Get the latest release and install it
```bash
curl -Lo /usr/bin/jaml https://github.com/yannoff/jaml/releases/latest/download/jaml
chmod +x /usr/bin/jaml
```
:bulb: _The `/usr/bin/jaml` path is just an example, fell free to replace by any custom binary file path._
### Checksums
Some checksum files are available to verify the `jaml` binary integrity:
- [jaml.md5](https://github.com/yannoff/jaml/releases/latest/download/jaml.md5)
- [jaml.sha384](https://github.com/yannoff/jaml/releases/latest/download/jaml.sha384)
_Here is an example using PHP_
```php
echo hash_file('sha384', 'https://github.com/yannoff/jaml/releases/latest/download/jaml');
```
## Credits
_**JAML** leverages [offenbach](https://github.com/yannoff/offenbach) for PHP dependency management._
Compiled as a PHAR self-executable using [PHP Code Compiler](https://github.com/yannoff/phpcc).
## License
Licensed under the [MIT License](LICENSE).