enactformatter

Formats and prettifies JSON with configurable indentation

⭐10stars🔀1forks📁View on GitHub🕐Updated Jan 3, 2026⬇️2downloads

When & Why to Use This Skill

The JSON Formatter skill is a specialized developer utility designed to transform minified or messy JSON strings into a clean, human-readable format. By supporting custom indentation levels and providing built-in validation, it ensures data integrity while significantly improving the readability of complex data structures for debugging and documentation purposes.

Use Cases

  • Debugging API Responses: Quickly format raw, minified JSON data from web services to identify structural issues, nested values, or missing fields during the development process.
  • Technical Documentation: Prettify JSON code snippets for inclusion in technical manuals, README files, or project reports to ensure professional presentation and clarity.
  • Configuration Management: Clean up and validate complex JSON configuration files (such as package.json or environment settings) to prevent syntax errors before deployment.
  • Data Inspection: Convert large, single-line JSON logs into a structured format to make manual data auditing and troubleshooting more efficient.
enact"2.0.0"
nameenact/formatter
version1.0.0
description"Number of spaces for indentation"
from"node:20-alpine"
command"node /workspace/format.js ${json} ${indent}"
typeinteger
default2

JSON Formatter

A simple tool that formats and prettifies JSON strings.

Usage

enact run enact/json-formatter --args '{"json": "{\"name\":\"test\",\"value\":123}", "indent": 2}'

Features

  • Validates JSON input
  • Configurable indentation (default: 2 spaces)
  • Returns structured output with validation status
  • Handles errors gracefully

Example Output

{
  "formatted": "{\n  \"name\": \"test\",\n  \"value\": 123\n}",
  "valid": true
}