jlcsv
v1.2.0
Published
Convert JSONL files to CSV format
Readme
jlcsv
Convert JSONL (JSON Lines) files to CSV format with a simple command.
Installation
Use with npx (no installation required)
npx jlcsv file.jsonlGlobal installation
npm install -g jlcsvUsage
Basic usage
# Convert a JSONL file to CSV (output: file.csv)
jlcsv file.jsonl
# Using npx
npx jlcsv documents.jsonlWith options
# Specify custom output file
jlcsv file.jsonl -o output.csv
jlcsv --file data.jsonl --output results.csv
# Get help
jlcsv --helpOptions
| Option | Alias | Description |
| ----------------- | ----- | ----------------------------------------------------------------- |
| --file <path> | -f | Input JSONL file |
| --output <path> | -o | Output CSV file (default: same name as input with .csv extension) |
| --format <type> | - | Output format (default: csv) |
| --help | -h | Show help message |
Examples
Simple conversion
jlcsv data.jsonl
# Output: data.csv in the same directoryCustom output location
jlcsv data.jsonl -o ../exports/converted.csvUsing flags
jlcsv --file input.jsonl --output output.csvInput format
Your JSONL file should contain one JSON object per line:
{"id": 1, "name": "Alice", "age": 30}
{"id": 2, "name": "Bob", "age": 25}
{"id": 3, "name": "Charlie", "age": 35}Output
The tool will create a CSV file with headers from the JSON keys:
id,name,age
1,Alice,30
2,Bob,25
3,Charlie,35Development
Local testing
# Clone the repository
git clone <your-repo-url>
cd jlcsv
# Install dependencies
npm install
# Link locally for testing
npm link
# Test the command
jlcsv test.jsonlPublishing
# Login to npm
npm login
# Publish
npm publishLicense
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
