1.0.5 β€’ Published 9 months ago

@kadirkiras/json-excel-converter v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

JSON and Excel Converter

npm version License: MIT Contributing

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-json

Command Line Options

OptionDescription
--to-excelForce conversion to Excel format
--to-jsonForce conversion to JSON format
--helpShow help message
--versionShow 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.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago