bestjsonformatter 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -0
- package/dist/cli.mjs +248 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Best JSON Formatter for agents
|
|
2
|
+
|
|
3
|
+
Private, deterministic JSON tools for MCP clients, coding agents, CI, and the
|
|
4
|
+
terminal. Documents are processed inside the local Node.js process. The package
|
|
5
|
+
does not make network requests or collect analytics.
|
|
6
|
+
|
|
7
|
+
## MCP
|
|
8
|
+
|
|
9
|
+
Add a stdio server with this command:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
npx -y bestjsonformatter mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The server exposes formatting, validation, repair, duplicate-key and
|
|
16
|
+
number-precision analysis, structural comparison, JSONPath, YAML/CSV/XML
|
|
17
|
+
conversion, and Draft 2020-12 JSON Schema tools.
|
|
18
|
+
|
|
19
|
+
## CLI
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
printf '%s' '{"id":9007199254740993}' | npx bestjsonformatter format --indent 2
|
|
23
|
+
npx bestjsonformatter validate response.json
|
|
24
|
+
npx bestjsonformatter duplicates response.json
|
|
25
|
+
npx bestjsonformatter precision response.json
|
|
26
|
+
npx bestjsonformatter compare before.json after.json
|
|
27
|
+
npx bestjsonformatter query '$.items[*].id' response.json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Run `npx bestjsonformatter --help` for every command.
|
|
31
|
+
|
|
32
|
+
## Correctness
|
|
33
|
+
|
|
34
|
+
Unlike a `JSON.parse()` and `JSON.stringify()` round trip, formatting preserves
|
|
35
|
+
duplicate object properties, integers beyond JavaScript's safe range, exponent
|
|
36
|
+
notation, and original escape spelling. Repair output is always a proposal for
|
|
37
|
+
review rather than an automatic source-file mutation.
|
|
38
|
+
|
|
39
|
+
Website and documentation: <https://bestjsonformatter.org/agents>
|