Code Monkey home page Code Monkey logo

json-utilities's Introduction

JSON Utilities

This repository contains two Bash scripts designed to work with JSON files: json-merger.sh for merging multiple JSON files into a single file, and json-linter.sh for validating JSON files.

json-merger.sh

json-merger.sh is a simple Bash script designed to merge multiple JSON files into a single JSON file containing a JSON array of the objects from the input files. This tool is especially useful when dealing with multiple configurations or data files in JSON format that need to be combined into a single file for processing or analysis.

Features

  • Combines multiple JSON files into a single JSON file.
  • Ensures the output is a valid JSON file by wrapping the contents in a JSON array.
  • Simple and easy to use, requiring only the Bash shell.

Installation & Usage

  1. Clone this repository or download the json-merger.sh file directly.
  2. Make the script executable: chmod +x json-merger.sh.
  3. Use the script by running: ./json-merger.sh jsonFile1.json jsonFile2.json [...jsonFileN.json].

json-linter.sh

json-linter.sh is a Bash script for validating JSON files. It uses jq to check if a given JSON file is valid. If the file is valid, the script outputs "Valid JSON"; otherwise, it prints "Invalid JSON".

Prerequisites

  • jq must be installed on your system to use json-linter.sh.

Installation & Usage

  1. Clone this repository or download the json-linter.sh file directly.
  2. Make the script executable: chmod +x json-linter.sh.
  3. Use the script by running: ./json-linter.sh jsonFile.json.

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Disclaimer

This repository and its content were generated by ChatGPT. While efforts have been made to ensure the scripts function as expected, they come with no guarantees or warranties. Users should review and test the scripts before using them in production environments.

json-utilities's People

Contributors

mrkara avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.