https://github.com/basemax/minifyjsonc
A simple C program to minify JSON files by removing whitespace and comments.
https://github.com/basemax/minifyjsonc
c c-json json json-c json-minifier json-minify minify-json
Last synced: about 2 months ago
JSON representation
A simple C program to minify JSON files by removing whitespace and comments.
- Host: GitHub
- URL: https://github.com/basemax/minifyjsonc
- Owner: BaseMax
- License: gpl-3.0
- Created: 2023-09-25T07:55:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-27T06:45:27.000Z (over 2 years ago)
- Last Synced: 2025-10-25T11:57:30.235Z (8 months ago)
- Topics: c, c-json, json, json-c, json-minifier, json-minify, minify-json
- Language: C
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JSON Minification Tool
A simple C program to minify JSON files by removing whitespace and comments.
## Introduction
JSON Minification Tool is a command-line utility that takes a JSON file as input, removes unnecessary whitespace and comments, and outputs a minified JSON file. Minified JSON is useful for reducing file size and improving performance when transmitting JSON data over the internet.
## Features
- Minify JSON by removing:
- Whitespace characters (spaces, tabs, newlines, and carriage returns).
- Single-line (`//`) and multiline (`/* ... */`) comments.
- Easy-to-use command-line interface.
- Supports both single-line and multiline comments within JSON data.
## Getting Started
### Prerequisites
- C compiler (e.g., GCC)
- Make (optional, for building)
- Git (optional, for cloning the repository)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/BaseMax/MinifyJSONC
```
Or download the ZIP file and extract it.
2. Build the JSON minification tool (optional):
```console
make
```
This step is optional, as you can also compile the C code using your preferred C compiler.
### Usage
To minify a JSON file, use the following command:
```console
./minify_json input.json output.json
```
- Replace input.json with the path to your input JSON file.
- Replace output.json with the desired name for the minified output JSON file.
Copyright 2023, Max Base