convt
v1.1.0
Published
convert files to each other:json,csv,xml,yaml
Maintainers
Readme
📦 convt — Universal File Converter CLI
convt is a fast, modern, lightweight CLI tool for converting structured data files
(JSON, CSV, TSV, XML, BSON, YAML, TOML, XLSX) into any other supported format.
Perfect for quick data transformations, scripting, pipelines, ETL workflows, developer utilities, and everyday CLI usage.
🚀 Features
- Convert between 9+ file formats
- Supports partial conversions (first, last, random, range)
- Extract a single column from tabular data
- Zero dependencies for most formats
- Built with modern Node.js (ESM)
- Works in pipelines (stdin → stdout)
- Fast and safe structure validation
📥 Installation
npm install -g convt
pnpm add -g convt
yarn global add convt🧠 Supported Formats
| Format | Read | Write | | ------ | ---- | ----- | | JSON | ✔️ | ✔️ | | CSV | ✔️ | ✔️ | | TSV | ✔️ | ✔️ | | XML | ✔️ | ✔️ | | YAML | ✔️ | ✔️ | | TOML | ✔️ | ✔️ | | BSON | ✔️ | ✔️ | | XLSX | ✔️ | ✔️ |
🔄 Convert Command
Usage
convt <file> [options]Options
| Option | Description | | ------------------- | ----------------------------------------------------------- | | --target | Target format (csv, json, xlsx, yaml, xml, bson, toml, tsv) | | --output | Output file path | | --first | Convert the first N rows | | --last | Convert the last N rows | | --random | Convert random N rows | | --range | Convert rows in a range |
Examples
convt data.json --target csv --output data.csv
convt data.csv --target json
convt data.csv --first 20 --target json
convt data.csv --range 50-100 --target tsv
convt logs.csv --random 10 --target json🔍 Extract Command
convt extract <file> [options]Options
| Option | Description | | ----------------- | ------------------ | | --column | Column to extract | | --key | Custom key name | | --output | Output file path | | --headless | Output only values | | --target | Output format |
Extract Examples
convt extract users.csv --column email --target json --output emails.json
convt extract users.csv --column id --headless --target txt
convt extract data.csv --column country --target yaml📤 STDIN Support
cat data.csv | convt --target json
curl https://example.com/data.csv | convt --target xlsx --output out.xlsx🧪 Exit Codes
| Code | Meaning | | ---- | ------------------ | | 0 | Success | | 1 | File not found | | 2 | Unsupported format | | 3 | Parse error | | 4 | Write error | | 5 | Invalid arguments |
🏗 Roadmap
- Streamed XLSX writer
- JSON → TOON format support
- Custom delimiter support
- Config file support
- Batch conversion
- Web UI wrapper
🤝 Contributing
PRs welcome!
📄 License
MIT License © 2025
