Json5Formatter
No description provided
Details
Installs
- Total 2K
- Win 900
- Mac 1K
- Linux 314
| Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 1 | 1 | 2 | 7 | 4 | 5 | 9 | 7 | 2 | 7 | 8 | 8 | 10 | 13 | 3 | 4 | 0 | 7 | 9 | 13 | 6 | 7 | 5 | 3 | 5 | 16 | 7 | 8 | 8 | 4 | 3 | 7 | 8 | 9 | 6 | 8 | 2 | 4 | 5 | 5 | 7 | 12 | 13 | 6 | 3 | 9 |
| Mac | 3 | 5 | 0 | 5 | 10 | 7 | 6 | 12 | 4 | 3 | 6 | 8 | 8 | 12 | 12 | 3 | 2 | 5 | 10 | 4 | 15 | 9 | 3 | 2 | 12 | 6 | 12 | 8 | 10 | 3 | 7 | 2 | 18 | 13 | 12 | 9 | 5 | 5 | 8 | 14 | 7 | 10 | 12 | 4 | 3 | 13 |
| Linux | 0 | 2 | 2 | 4 | 3 | 0 | 2 | 1 | 1 | 0 | 1 | 2 | 1 | 3 | 3 | 1 | 0 | 2 | 6 | 4 | 4 | 2 | 1 | 2 | 1 | 4 | 4 | 4 | 3 | 0 | 1 | 4 | 2 | 2 | 4 | 1 | 0 | 2 | 1 | 3 | 4 | 3 | 3 | 4 | 3 | 3 |
Readme
- Source
- raw.githubusercontent.com
Json5Formatter
A Sublime Text plugin that formats JSON/JSON5 files using the system Python's json5 library.
Features
| Command | Description |
|---|---|
| JSON5: Format as JSON | Format and output standard JSON, preserving comments |
| JSON5: Format as JSON5 | Format as JSON5 style (comments not preserved) |
| JSON5: Minify | Compress to single-line JSON |
- Supports JSON5 syntax:
//and/* */comments, single-quoted strings, trailing commas, unquoted keys - Auto-converts single quotes → double quotes, unquoted keys → quoted keys
- Outputs standard JSON (no trailing commas)
Installation
Prerequisites
- Python 3.x (on system PATH)
json5library:pip install json5
Package Control (Recommended)
Search for Json5Formatter in Package Control:
Ctrl+Shift+P→Package Control: Install Package- Type
Json5Formatter→ Enter
Manual Install
Sublime Text 4
cd <Packages directory> (Preferences → Browse Packages...)
git clone git@github.com:RAMBOO1990/sublime-json5.git "Json5Formatter"
Usage
Command Palette
Press Ctrl+Shift+P, type JSON5:, and select the desired command.
Key Binding
| Keys | Command |
|---|---|
Ctrl+Shift+J |
Format as JSON |
Customize in Default.sublime-keymap.
Settings
Preferences → Package Settings → Json5Formatter → Settings
{
// Number of spaces per indent level
"indent": 4,
// Sort object keys alphabetically
"sort_keys": false,
// Escape non-ASCII characters
"ensure_ascii": false
}
sort_keysandensure_asciionly apply to the Format as JSON5 and Minify commands. Format as JSON uses the built-in formatter and does not currently support these options.
License
MIT