Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cli support #43

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Conversation

Valley-15
Copy link
Contributor

Pull Request Description for @muhtalhakhan issue #32: Implement CLI Support for JSON to CSV Converter

This pull request addresses Issue #32, which focuses on adding command-line interface (CLI) support for the json-to-csv.js utility script. This enhancement allows users to convert JSON files to CSV format directly from the command line, improving usability and accessibility.

Key Changes:

  • CLI Implementation: Integrated the commander package for command-line argument parsing.

  • Command Usage: The script can be executed as follows:

    node jsontocsv.js <inputFile> <outputFile> [options]
    • <inputFile>: Path to the JSON file for conversion.
    • <outputFile>: Path for saving the resulting CSV file.
    • [options]: Optional flags for customization.
  • Available Options:

    • --delimiter <delimiter>: Specify a custom delimiter (default is ,).
    • --no-headers: Exclude headers in the CSV output.
  • Documentation Update: Revised README.md with clear instructions, including example commands.

  • Sample Data: Added input.json and output.csv in the utilities/ folder for testing.

This enhancement significantly improves the utility's functionality, making it more user-friendly and flexible for various use cases.

@muhtalhakhan muhtalhakhan merged commit 79f9cca into muhtalhakhan:main Oct 16, 2024
5 of 6 checks passed
@muhtalhakhan muhtalhakhan added hacktoberfest Helps to differentiate Hacktoberfest PRs hacktoberfest-accepted Helps to achieve Hacktoberfest PRs labels Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Helps to differentiate Hacktoberfest PRs hacktoberfest-accepted Helps to achieve Hacktoberfest PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants