formatforge
Convert between data formats from the command line.
Supported formats
| Format | Extension | Notes |
|---|---|---|
| JSON | .json |
|
| TOML | .toml |
No null values |
| YAML | .yaml, .yml |
|
| XML | .xml |
|
| ENV | .env |
Key=value pairs |
| KDL | .kdl |
kdl-lang.com |
| CBOR | .cbor |
Binary format |
| INI | .ini |
|
| JSON5 | .json5 |
Comments, trailing commas |
| JSONC | .jsonc |
JSON with comments |
| MessagePack | .msgpack |
Binary format |
Note: TOML and XML may not preserve key/attribute order after conversion.
Installation
Aliases
Two binaries are installed:
Usage
# Format is detected automatically from file extension
# Pack to binary
# Unpack from binary
# Override format manually
Examples
Convert a JSON config to TOML:
Escape XML hell:
Pack data for transport, unpack for reading:
License
MIT — see LICENSE