JSON

Data format.

dhaupin 87b36b2 805 B Updated

File contents

JSON

Data format.


When To Use

  • APIs
  • Config files
  • Data interchange

What To Do

1. Syntax

{
  "key": "value",
  "number": 42,
  "boolean": true,
  "null": null,
  "array": [1, 2, 3],
  "object": {
    "nested": "value"
  }
}

2. Parse

// JavaScript
const data = JSON.parse(string)
const string = JSON.stringify(data, null, 2)

3. Validate

# Python
python -c "import json; json.load(open('f.json'))"

# Node
node -e "JSON.parse(require('fs').readFileSync('f.json'))"

4. Tools

Tool Use
jq CLI processing
jsonlint Validation
jsondiff Diff

Role: JSON Handler
Input: JSON
Output: Data

Data format.

dhaupin/vant/tree/main/models/public/skills/vant-skill-json commit 87b36b2a23

Frequently asked questions

npx skillmds@latest add dhaupin/json