JSON Processor
A Visual Studio Code extension that provides tools for processing JSON files by deduplicating or sorting JSON keys.
Features
This extension provides two main features:
- Deduplicate JSON Keys: Removes duplicate keys from JSON objects while preserving the first occurrence of each key.
- Sort JSON Keys: Sorts all keys in JSON objects alphabetically.
Both operations:
- Work recursively on nested objects
- Preserve the original values
- Maintain proper JSON formatting
- Handle arrays properly
- Provide immediate feedback
Installation
- Open Visual Studio Code
- Press
Ctrl+P
(Windows/Linux) or Cmd+P
(macOS)
- Type
ext install json-processor
- Press Enter
Usage
- Open a JSON file in VS Code
- Right-click in the editor
- Choose either:
- "Deduplicate JSON Keys" to remove duplicate keys
- "Sort JSON Keys" to sort keys alphabetically
Example:
Original JSON:
{
"b": 1,
"a": 2,
"b": 3,
"c": {
"y": 1,
"x": 2,
"y": 3
}
}
After deduplication:
{
"b": 1,
"a": 2,
"c": {
"y": 1,
"x": 2
}
}
After sorting:
{
"a": 2,
"b": 1,
"c": {
"x": 2,
"y": 1
}
}
Requirements
- Visual Studio Code version 1.80.0 or higher
Extension Settings
This extension does not add any VS Code settings.
License
This project is licensed under the MIT License - see the LICENSE file for details.