Skip to content
/ jfmt Public

JSON formatter written in Rust using Pest for the grammar

License

Notifications You must be signed in to change notification settings

vbergae/jfmt

Repository files navigation

jfmt - JSON Formatter

jfmt is a command-line application for parsing and formatting JSON text. It reads JSON input from the terminal, formats it for readability, and outputs the formatted JSON to the terminal.

Features

  • Parse and format JSON text
  • Output formatted JSON to the terminal
  • Simple and easy-to-use command-line interface

Installation

To build and install jfmt, you need to have Rust installed on your system.

  1. Clone the repository:

    git clone https://github.com/vbergae/jfmt.git
    cd jfmt
  2. Build the project:

    cargo build --release
  3. Install the application:

    cargo install --path .

Examples

Example 1: Formatting JSON from a file

jfmt < data.json

Example 2: Formatting JSON from a string

echo '{"name":"John","age":30,"city":"New York"}' | jfmt

Development

To contribute to jfmt, follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Make your changes and commit them.
  4. Push your changes to your fork.
  5. Create a pull request to the main repository.

Running Tests

To run the tests for jfmt, use the following command:

cargo test

License

This project is licensed under the GPL v3 License. See the LICENSE file for details.

Included Software

This project includes files that are licensed under the Apache License, Version 2.0. Specifically, the following file(s):

  • src/json.pest

These files retain their original license. You may not use these files except in compliance with the Apache License, Version 2.0. You may obtain a copy of the license at http://www.apache.org/licenses/LICENSE-2.0.

Contact

For any questions or feedback, please open an issue on the GitHub repository or contact the project maintainer.


Happy formatting!

About

JSON formatter written in Rust using Pest for the grammar

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages