https://github.com/krishana7911/json-to-table-cli
[Under Progress ] npm package to convert JSON and CSV data into a Markdown table. Supports both API responses and local JSON files.
https://github.com/krishana7911/json-to-table-cli
api cli csv-to-markdown developer-tools json json-to-table markdown table
Last synced: 2 months ago
JSON representation
[Under Progress ] npm package to convert JSON and CSV data into a Markdown table. Supports both API responses and local JSON files.
- Host: GitHub
- URL: https://github.com/krishana7911/json-to-table-cli
- Owner: krishana7911
- Created: 2025-02-18T11:01:22.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-21T14:07:12.000Z (over 1 year ago)
- Last Synced: 2025-12-30T12:40:21.719Z (6 months ago)
- Topics: api, cli, csv-to-markdown, developer-tools, json, json-to-table, markdown, table
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON to Table CLI
A simple and lightweight CLI tool to convert JSON data (from files or API responses) into a human-readable Markdown table format. Perfect for documentation or quick data viewing.
## 🚀 Features
- 📁 Convert a local JSON file to a Markdown table.
- 🌐 Fetch JSON data directly from an API and convert it to a table.
- 📝 Output the table to a `.md` file for easy documentation integration.
- ❌ Error handling for invalid JSON input or missing parameters.
## 📦 Installation
You can either install the CLI globally or run it with `npx` without installation.
### Using `npx` (No Installation Required)
Run the following command to execute the tool:
```bash
npx json-to-table-cli --url --output
```
### Install Globally
To install the tool globally:
```bash
npm install -g json-to-table-cli
```
## 📝 Usage
### 1. Convert JSON from an API to Markdown Table
```bash
json-to-table-cli --url https://jsonplaceholder.typicode.com/users --output users-table.md
```
### 2. Convert a Local JSON File to Markdown Table
```bash
json-to-table-cli --file ./data/users.json --output users-table.md
```
### 3. Display Help
```bash
json-to-table-cli --help
```
## 📊 Example Output
Given the following JSON:
```json
[
{ "id": 1, "name": "John Doe", "email": "john@example.com" },
{ "id": 2, "name": "Jane Smith", "email": "jane@example.com" }
]
```
The generated `users-table.md` will look like this:
```markdown
| ID | Name | Email |
| --- | ----------- | ----------------- |
| 1 | John Doe | john@example.com |
| 2 | Jane Smith | jane@example.com |
```
## 🛠️ Error Handling
If something goes wrong, you'll get a clear error message. Common issues include:
- Invalid JSON format.
- Missing `--url` or `--file` parameter.
- File path or API endpoint not accessible.
## 🤝 Contributing
Contributions are welcome! If you'd like to add new features or improve the code, feel free to fork the repo and submit a pull request.
## 📜 License
This project is licensed under the MIT License.