कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

json-repair-kit

wanng-ide द्वारा

PDF & Documents
502clawskills.sh द्वारा बताए गए डाउनलोड
1व्यूज़
0 लाइकइस स्किल को लाइक करने के लिए साइन इन करें
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Repair malformed JSON files by normalizing them through Node.js evaluation.

विवरण

यह स्किल क्या करती है

Repairs malformed JSON files by parsing them as JavaScript objects and re-serializing as strict JSON. Handles trailing commas, single quotes, unquoted keys, JS-style comments, and hex/octal numbers. Operates on single files or entire directories recursively.

Uses vm.runInNewContext instead of direct eval, making it safer than regex-based fixers while handling a broader set of syntax errors in one pass.

इसे कब इस्तेमाल करें

  • Fixing config files with trailing commas added by hand-editing
  • Converting JS object literals copied into .json files
  • Batch-repairing all JSON files in a project directory
  • Normalizing JSON exported from tools using loose syntax
  • Recovering manually edited data files with mixed quote styles

उदाहरण वर्कफ़्लो

इनपुट

User asks: Repair my broken config.json that has trailing commas and unquoted keys

एजेंट
  1. 1

    Identifies the broken JSON file at the specified path

  2. 2

    Creates a .bak backup of the original file

  3. 3

    Parses the file content using vm.runInNewContext as a JavaScript object

  4. 4

    Re-serializes the result as valid JSON

  5. 5

    Validates the output before writing it back to disk

आउटपुट

config.json is overwritten with valid JSON; config.json.bak preserves the original

इंस्टॉलेशन

clawhub install wanng-ide/json-repair-kit

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक