Skip to content

A powerful JSON formatter, validator, and converter that supports 20+ format conversions and code generation.

Notifications You must be signed in to change notification settings

cenyi/neo-dev-toolkit

Repository files navigation

JSON Formatter & Multi-Format Converter

Version License Astro Cloudflare

The Ultimate JSON Toolkit - 20+ Format Conversions & Code Generation

Features β€’ Quick Start β€’ Documentation β€’ Demo


✨ Overview

A powerful, browser-based JSON toolkit that supports 20+ format conversions, code generation, and advanced JSON operations. 100% client-side processing - your data never leaves your browser!

🌟 Key Highlights

  • 🎯 Smart Input Detection: Auto-detects JSON, URL params, XML, YAML & 15+ formats
  • πŸ”„ 20+ Conversions: JSON ↔ YAML/XML/CSV/HTML/PDF/Table & more
  • πŸ’» Code Generation: TypeScript, Dart, Go, Rust, Python, C, JSON Schema
  • πŸ” Advanced Tools: JSON compare, diff, field extraction, validation
  • 🌐 Bilingual: Full English & Chinese support
  • πŸ“± Mobile-Optimized: Perfect on all devices
  • πŸ”’ Privacy-First: 100% browser-based, no server uploads
  • ⚑ Lightning Fast: Handles 10MB+ JSON files effortlessly

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/cenyi/neo-dev-toolkit.git

# Navigate to project directory
cd neo-dev-toolkit

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

Quick Demo

  1. Open your browser and navigate to http://localhost:4321
  2. Paste any JSON into the editor
  3. Watch it auto-format and validate instantly
  4. Click any conversion button to transform your data

🎯 Features

Core JSON Operations

1. Smart Input Detection 🧠

Automatically detects and parses:

  • βœ… Standard JSON
  • βœ… URL Parameters (query strings)
  • βœ… XML documents
  • βœ… YAML files
  • βœ… JSON with comments
  • βœ… Minified JSON

Example: Just paste ?name=John&age=30 and it auto-converts to JSON!

2. JSON Formatting & Validation ✨

  • Real-time syntax highlighting
  • Error detection with line numbers
  • Auto-formatting on paste
  • Collapsible tree view
  • Line numbers navigation

3. JSON Comparison & Diff πŸ”„

  • Side-by-side comparison
  • Visual diff highlighting:
    • 🟒 Green: Added
    • πŸ”΄ Red: Removed
    • 🟑 Yellow: Modified
  • Perfect for API testing and config changes

4. Field Extraction πŸ”

Use JavaScript expressions to extract data:

// Extract nested field
obj => obj.user.name

// Extract from array
obj => obj.items[0].id

// Transform data
obj => obj.users.map(u => u.email)

// Filter and map
obj => obj.items.filter(i => i.price > 100).map(i => i.name)

πŸ”„ Data Format Conversions

JSON to YAML

Convert JSON to YAML format with proper indentation:

name: John Doe
email: [email protected]
age: 30
address:
  street: 123 Main St
  city: New York

JSON to XML

Generate XML with proper structure and escaping.

JSON to CSV/Excel

  • Convert JSON arrays to CSV format
  • Handle nested objects
  • Excel-compatible output
  • One-click copy to clipboard

JSON to HTML

Generate formatted HTML with syntax highlighting:

<!DOCTYPE html>
<html>
<head><title>JSON Data</title></head>
<body>
<pre class="json-key">"name"</pre>: <pre class="json-string">"John"</pre>
...
</body>
</html>

JSON to PDF

Export JSON as PDF via browser print with formatting preserved.

JSON to Table

Visualize JSON data as beautiful HTML tables:

  • Arrays become row-based tables
  • Objects become key-value tables
  • Type-based color coding
  • Responsive design

πŸ’» Code Generation

TypeScript Interface

interface UserData {
  name: string;
  email: string;
  age: number;
  address: {
    street: string;
    city: string;
  };
}

Dart Class (Flutter)

class UserData {
  String name;
  String email;
  int age;
  Address address;

  UserData({this.name, this.email, this.age, this.address});

  factory UserData.fromJson(Map<String, dynamic> json) {
    return UserData(
      name: json['name'],
      email: json['email'],
      age: json['age'],
      address: Address.fromJson(json['address']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'name': name,
      'email': email,
      'age': age,
      'address': address?.toJson(),
    };
  }
}

Go Struct

type UserData struct {
    Name    string  `json:"name"`
    Email   string  `json:"email"`
    Age     int     `json:"age"`
    Address Address `json:"address"`
}

Rust Struct

#[derive(Serialize, Deserialize)]
struct UserData {
    name: String,
    email: String,
    age: i64,
    address: Address,
}

Python Dataclass

from dataclasses import dataclass
from typing import Optional

@dataclass
class UserData:
    name: str
    email: str
    age: int
    address: Optional['Address'] = None

C Struct

typedef struct {
    char* name;
    char* email;
    int age;
    Address* address;
} UserData;

JSON Schema

Generate standard JSON Schema for validation:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "name": {"type": "string"},
    "email": {"type": "string"},
    "age": {"type": "number"}
  },
  "required": ["name", "email", "age"]
}

πŸ› οΈ Utility Tools

JSON Minify

  • Remove all whitespace
  • Compress to single line
  • Perfect for production APIs

JSON Escape

  • Escape special characters
  • Safe for string embedding
  • One-click copy

Comment Removal

  • Strip JSON5-style comments
  • Clean up for production
  • Preserve data integrity

History Management

  • Local storage persistence
  • Quick access to recent JSONs
  • Privacy-focused (local only)

πŸ“– Usage Examples

Example 1: API Response Processing

{
  "status": "success",
  "data": {
    "users": [
      {"id": 1, "name": "Alice", "email": "[email protected]"},
      {"id": 2, "name": "Bob", "email": "[email protected]"}
    ]
  }
}

Extract all emails:

obj => obj.data.users.map(u => u.email)

Result: ["[email protected]", "[email protected]"]

Example 2: Config File Conversion

YAML Input:

server:
  host: localhost
  port: 8080
  ssl: true

Auto-detects as YAML β†’ Converts to JSON β†’ Generate Go Struct β†’ Copy to code

Example 3: JSON Comparison

Before:

{"name": "John", "age": 30, "city": "NYC"}

After:

{"name": "John", "age": 31, "city": "LA"}

Shows:

  • 🟑 age: 30 β†’ 31
  • 🟑 city: "NYC" β†’ "LA"

Example 4: URL Params Parsing

Input: ?search=json&page=1&limit=10

Auto-converts to:

{
  "search": "json",
  "page": 1,
  "limit": 10
}

Example 5: Array to Table

Input:

[
  {"product": "Laptop", "price": 999, "stock": 50},
  {"product": "Mouse", "price": 29, "stock": 200}
]

Generates Table:

product price stock
Laptop 999 50
Mouse 29 200

Example 6: Code Generation Workflow

  1. Paste API response JSON
  2. Click "JSON to TypeScript"
  3. Get interface definition
  4. Use in your TypeScript project
  5. Save hours of manual typing!

🎨 UI Features

Responsive Design

  • πŸ–₯️ Desktop: Multi-column layout with side-by-side editors
  • πŸ“± Tablet: Optimized 2-column grid
  • πŸ“² Mobile: Single column with touch-friendly buttons

Button Organization

Buttons are grouped by functionality:

[Basics] | [Data Conversions] | [Code Generation] | [Analysis] | [Utilities]

Basics: Collapse, Expand, Remove Comments, Compress, Escape Data Conversions: XML, YAML, CSV, Excel, HTML, PDF Code Generation: TypeScript, Dart, C, Go, Rust, Python, Schema Analysis: Table, Compare Utilities: Clear, History, Font Size

Smart Features

  • 🎨 Syntax Highlighting: Monaco Editor (VS Code engine)
  • πŸŒ“ Theme Support: Auto dark/light mode
  • πŸ“ Font Size Control: 11px - 16px adjustable
  • πŸ”€ Bilingual UI: Instant English/Chinese switch
  • ⌨️ Keyboard Shortcuts: Quick actions support

πŸ”§ Technical Details

Technology Stack

Component Technology Version
Framework Astro 4.15+
Editor Monaco Editor Latest
Styling Native CSS -
Language JavaScript ES6+
Deployment Cloudflare Pages/Workers -

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           User Browser                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚    Astro Frontend Application    β”‚  β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”‚
β”‚  β”‚  β€’ Smart Input Detection          β”‚  β”‚
β”‚  β”‚  β€’ Format Conversion Engine       β”‚  β”‚
β”‚  β”‚  β€’ Code Generation Modules        β”‚  β”‚
β”‚  β”‚  β€’ Monaco Editor Integration      β”‚  β”‚
β”‚  β”‚  β€’ History Management (Local)     β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                         β”‚
β”‚  100% Client-Side Processing           β”‚
β”‚  ❌ No Server Uploads                  β”‚
β”‚  βœ… Complete Privacy                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Performance Optimizations

  • Lazy Loading: Monaco Editor loaded on demand
  • Debouncing: Smart input processing
  • Virtual Scrolling: Handle large JSON files
  • Local Storage: Instant history access
  • CSS Hardware Acceleration: Smooth animations
  • Minimal Bundle Size: Optimized dependencies

Browser Compatibility

Browser Version Status
Chrome/Edge 90+ βœ… Full Support
Firefox 88+ βœ… Full Support
Safari 14+ βœ… Full Support
Opera 76+ βœ… Full Support
Mobile Safari 14+ βœ… Full Support
Chrome Mobile 90+ βœ… Full Support

πŸ“¦ File Structure

neo-dev-toolkit/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ index.astro          # English homepage
β”‚   β”‚   └── zh/
β”‚   β”‚       └── index.astro      # Chinese homepage
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ JsonEditor.astro     # Editor component
β”‚   β”‚   β”œβ”€β”€ JsonTreeView.astro   # Tree view component
β”‚   β”‚   └── Sidebar.astro        # Navigation sidebar
β”‚   β”œβ”€β”€ layouts/
β”‚   β”‚   └── BaseLayout.astro     # Base layout
β”‚   └── i18n/
β”‚       └── locales.js           # Translations (EN/ZH)
β”œβ”€β”€ public/                      # Static assets
β”œβ”€β”€ dist/                        # Build output
β”œβ”€β”€ astro.config.mjs             # Astro configuration
β”œβ”€β”€ package.json                 # Dependencies
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ README.zh.md                 # Chinese version
└── FEATURES_SUMMARY.md          # Feature summary

🚒 Deployment

Cloudflare Pages (Recommended)

Option 1: Direct Upload

# Build the project
npm run build

# Deploy using Wrangler CLI
npm install -g wrangler
wrangler login
wrangler pages deploy dist

Option 2: Git Integration

  1. Push code to GitHub/GitLab
  2. Connect repository to Cloudflare Pages
  3. Configure build settings:
    • Framework: Astro
    • Build Command: npm run build
    • Output Directory: dist
    • Node.js Version: 18 or 20
  4. Deploy automatically on push

Other Platforms

Vercel

npm install -g vercel
vercel

Netlify

npm install -g netlify-cli
netlify deploy --prod

Environment Variables

No environment variables required! The app runs entirely in the browser.


πŸ”‘ SEO Keywords

This tool is optimized for the following keywords:

Core Keywords

  • json formatter
  • json validator
  • json parser
  • json viewer
  • json editor
  • json beautifier
  • json minify
  • json compare
  • json diff

Conversion Keywords

  • json to yaml
  • json to xml
  • json to csv
  • json to excel
  • json to html
  • json to pdf
  • json to table
  • json to dart
  • json to go
  • json to rust
  • json to python
  • json to c
  • json to typescript

Feature Keywords

  • json schema
  • json escape
  • json stringify
  • json pretty print
  • json format
  • json lint
  • json viewer online
  • json formatter online

Chinese Keywords (δΈ­ζ–‡)

  • jsonζ ΌεΌεŒ–
  • json在线解析
  • jsonεœ¨ηΊΏζ ΌεΌεŒ–
  • json ζ•΄ε½’
  • jsonηΎŽεŒ–
  • json转yaml
  • json转葨格

πŸŽ“ Use Cases

For Developers

  • βœ… Debug API responses
  • βœ… Generate TypeScript interfaces
  • βœ… Convert config files
  • βœ… Compare JSON differences
  • βœ… Generate data models

For Data Analysts

  • βœ… Convert JSON to CSV/Excel
  • βœ… Visualize data as tables
  • βœ… Extract specific fields
  • βœ… Validate data structure

For QA Engineers

  • βœ… Compare API responses
  • βœ… Validate JSON schemas
  • βœ… Format error messages
  • βœ… Test data transformation

For Students/Learners

  • βœ… Learn JSON structure
  • βœ… Understand data formats
  • βœ… Practice data conversion
  • βœ… Study code generation

🌟 Key Features Summary

Feature Description Status
Smart Input Auto-detects 15+ formats βœ…
JSON Validation Real-time error checking βœ…
Format Conversions 10+ output formats βœ…
Code Generation 7 programming languages βœ…
JSON Compare Visual diff tool βœ…
Field Extraction JavaScript expressions βœ…
Table View HTML table generation βœ…
History Local storage βœ…
Mobile Support Responsive design βœ…
Bilingual English + Chinese βœ…
Privacy 100% client-side βœ…
Offline Works without internet βœ…

🀝 Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Development Setup

# Fork the repository
# Clone your fork
git clone https://github.com/YOUR-USERNAME/neo-dev-toolkit.git

# Create a feature branch
git checkout -b feature/amazing-feature

# Make your changes
# Commit your changes
git commit -m 'Add amazing feature'

# Push to branch
git push origin feature/amazing-feature

# Create a Pull Request

πŸ“Š Performance

  • ⚑ Format Speed: < 100ms for 1MB JSON
  • πŸ“¦ Bundle Size: < 500KB (gzipped)
  • πŸš€ Load Time: < 2s on 3G
  • πŸ’Ύ Memory Usage: < 100MB for 10MB JSON
  • πŸ”„ Conversion Speed: < 500ms for most formats

πŸ”’ Privacy & Security

  • βœ… No Server Uploads: All processing in browser
  • βœ… No Analytics: No tracking code
  • βœ… No Cookies: No user tracking
  • βœ… HTTPS: Secure connection
  • βœ… Open Source: Fully auditable code
  • βœ… Local Storage: History stays on your device

πŸ“ License

MIT License - see LICENSE file for details


πŸ™ Acknowledgments


πŸ“ž Support


Made with ❀️ by the JSON Tools Team

⭐ Star us on GitHub β€” it helps!

πŸ”— Live Demo β€’ πŸ“– Docs β€’ πŸ› Issues

About

A powerful JSON formatter, validator, and converter that supports 20+ format conversions and code generation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published