to-maml
v1.0.1
Published
Convert JSON, YAML, and TOML to MAML
Readme
to-maml
Convert JSON, YAML, and TOML to MAML.
Preserves comments and empty lines from YAML and TOML sources.
Install
npm install -g to-mamlUsage
to-maml [options] [file]JSON is the default format. File extension is used for auto-detection when a file is given.
Options
| Flag | Description |
| ---------- | ------------- |
| --yaml | Input is YAML |
| --toml | Input is TOML |
| -h, --help | Show help |
Examples
# Convert JSON (default)
to-maml data.json
cat data.json | to-maml
# Convert YAML (auto-detected from extension)
to-maml config.yaml
# Convert YAML from stdin
cat config.yml | to-maml --yaml
# Convert TOML
to-maml settings.toml
cat Cargo.toml | to-maml --tomlJSON
echo '{"name": "Alice", "age": 30}' | to-maml{
name: "Alice"
age: 30
}YAML with comments
to-maml config.yaml# Database config
database:
host: localhost # main server
port: 5432{
# Database config
database: {
host: "localhost" # main server
port: 5432
}
}TOML with comments
to-maml config.toml# Server settings
[server]
host = "0.0.0.0" # bind address
port = 8080{
# Server settings
server: {
host: "0.0.0.0" # bind address
port: 8080
}
}