1.0.5 β’ Published 9 months ago
@kadirkiras/json-excel-converter v1.0.5
JSON and Excel Converter
A powerful Node.js application that provides bidirectional conversion between JSON and Excel formats. This tool is perfect for data analysts, developers, and anyone who needs to work with both JSON and Excel files.
β¨ Features
- π Bidirectional conversion (JSON β Excel)
- π Automatic column width adjustment
- π¨ Bold formatting for header rows
- π Support for both .xlsx and .xls formats
- π Automatic format detection
- π οΈ Simple command-line interface
- π¦ Can be used as a module in other projects
- π High performance with large datasets
- πͺ Error handling and validation
π¦ Installation
# Install globally
npm install -g @kadirkiras/json-excel-converter
# Install as a project dependency
npm install @kadirkiras/json-excel-converterπ Usage
Command Line Interface
# Convert JSON to Excel
json-excel-converter data.json [output.xlsx]
json-excel-converter data.json output.xlsx --to-excel
# Convert Excel to JSON
json-excel-converter data.xlsx [output.json]
json-excel-converter data.xlsx output.json --to-jsonCommand Line Options
| Option | Description |
|---|---|
--to-excel | Force conversion to Excel format |
--to-json | Force conversion to JSON format |
--help | Show help message |
--version | Show version number |
As a Module
const {
convertJsonToExcel,
convertExcelToJson,
} = require("@kadirkiras/json-excel-converter");
// Convert JSON to Excel
const jsonData = [
{ id: 1, name: "John", age: 30 },
{ id: 2, name: "Jane", age: 25 },
];
await convertJsonToExcel(jsonData, "output.xlsx");
// Convert Excel to JSON
const jsonData = await convertExcelToJson("input.xlsx");π Examples
JSON to Excel
const data = [
{ name: "John", age: 30, city: "New York" },
{ name: "Jane", age: 25, city: "London" },
];
await convertJsonToExcel(data, "output.xlsx");Excel to JSON
const jsonData = await convertExcelToJson("input.xlsx");
console.log(jsonData);
// Output:
// [
// { name: "John", age: 30, city: "New York" },
// { name: "Jane", age: 25, city: "London" }
// ]π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure to update tests as appropriate.
π§ͺ Development
# Clone the repository
git clone https://github.com/kadirkiras/json-excel-converter.git
# Install dependencies
npm install
# Run tests
npm testπ Documentation
For more detailed documentation, please visit our GitHub Wiki.
π Known Issues
- Large Excel files (>100MB) might take longer to process
- Complex Excel formulas are not supported in conversion
π Roadmap
- Support for Excel formulas
- Custom styling options
- Multiple sheet support
- Progress bar for large files
- Web interface
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- ExcelJS - The Excel manipulation library used in this project
- All contributors who have helped shape this project
π Support
If you find this project helpful, please consider giving it a star on GitHub. For issues and feature requests, please use the GitHub issue tracker.
π€ Connect
- GitHub: @kadirkiras
- X: @codekadir
- LinkedIn: Kadir KiraΕ