https://github.com/taskie/jc
convert between JSON-like formats
https://github.com/taskie/jc
json messagepack toml yaml
Last synced: 2 months ago
JSON representation
convert between JSON-like formats
- Host: GitHub
- URL: https://github.com/taskie/jc
- Owner: taskie
- License: apache-2.0
- Created: 2018-03-07T16:04:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T00:12:21.000Z (over 3 years ago)
- Last Synced: 2025-08-13T12:54:42.291Z (11 months ago)
- Topics: json, messagepack, toml, yaml
- Language: Go
- Homepage:
- Size: 480 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jc
convert between JSON-like formats

## Install
```sh
go install -u github.com/taskie/jc/cmd/jc
```
## Usage
### Convert
```sh
jc foo.json foo.yaml
jc foo.yaml foo.toml
jc foo.toml foo.msgpack
jc foo.msgpack foo.json
```
or
```sh
jc -t yaml foo.yaml
jc -f yaml -t toml foo.toml
jc -f toml -t msgpack foo.msgpack
jc -f msgpack foo.json
```
#### Input File (foo.json)
```json
{"message":[{"hello":true},{"world":42}]}
```
#### Output File (foo.yaml)
```yaml
message:
- hello: true
- world: 42
```
#### Output File (foo.toml)
```toml
[[message]]
hello = true
[[message]]
world = 42
```
#### Output File (foo.msgpack)
```sh
xxd foo.msgpack
```
```
00000000: 81a7 6d65 7373 6167 6592 81a5 6865 6c6c ..message...hell
00000010: 6fc3 81a5 776f 726c 64d3 0000 0000 0000 o...world.......
00000020: 002a .*
```
## Dependency

## License
Apache License 2.0