Transform JSON data with powerful MongoDB-style operators
- π¨ Material Oceanic Theme - Professional dark theme by default with Dreamweaver Light mode option
- β‘ Real-time Transformation - Instant JSON transformation with MongoDB-style operators
- π‘ Smart Examples - Product-focused examples to get you started
- β¨ Auto-formatting - Beautify JSON with one click
- π Copy to Clipboard - Easy result copying
- β¨οΈ Keyboard Shortcuts - Efficient workflow with shortcuts
- π― Syntax Highlighting - Color-coded JSON for better readability
- π± Responsive Design - Works on all devices
- π Interactive API Reference - Searchable operator documentation with autocomplete
Visit the live playground: https://dmberlin.github.io/json-forgefy/
Ctrl/Cmd + Enter- Transform JSONCtrl/Cmd + K- Open API ReferenceTabin projection - Trigger autocomplete
# Install dependencies
pnpm install
# Build everything (API reference + browser bundle)
pnpm run build
# Build API reference only (from GUIDE.md)
pnpm run build:api
# Build browser bundle only
pnpm run build:browser
# Start development server
pnpm run serve
# Or build and serve
pnpm run devThen open http://localhost:8001 in your browser (or the port specified in env file).
Create a .env file in the project root:
# .env
GUIDE_URL=https://raw.githubusercontent.com/DMBerlin/json-forgefy/refs/heads/main/GUIDE.md
PORT=8001Required:
GUIDE_URL- URL to the GUIDE.md file (required, no default)
Optional:
PORT- Server port (defaults to 8000)
The playground's API reference is auto-generated from GUIDE.md:
pnpm run build:apiHow it works:
- Fetches
GUIDE.mdfrom the remote URL specified inGUIDE_URLenvironment variable - Extracts operator names, descriptions, categories, parameters, examples
- Generates
api-reference-data.jswith structured data - Powers autocomplete and API reference sidebar
Note: GUIDE_URL environment variable is required. Set it in .env file or as an environment variable.
When to rebuild:
- After updating the remote
GUIDE.mdfile - After adding new operators
- After changing operator descriptions or examples
Creates a browser-compatible library bundle:
pnpm run build:browserHow it works:
- Creates temporary entry point importing
json-forgefy - Bundles with esbuild into IIFE format
- Exposes
window.Forgefyfor browser use - Cleans up temporary files
playground/
βββ build-api-reference.js # GUIDE.md parser
βββ build-browser.js # Browser bundle builder
βββ api-reference-data.js # Generated operator data
βββ forgefy-browser.js # Generated browser bundle
βββ app.js # Application logic
βββ styles.css # Theming and styles
βββ index.html # Main interface
βββ favicon.svg # Favicon
βββ package.json # Dependencies
βββ README.md # This file
Input Payload:
{
"user": {
"firstName": "Sarah",
"lastName": "Johnson",
"email": "sarah.johnson@company.com"
}
}Projection Blueprint:
{
"fullName": {
"$concat": ["$user.firstName", " ", "$user.lastName"]
},
"email": {
"$toLower": "$user.email"
}
}Result:
{
"fullName": "Sarah Johnson",
"email": "sarah.johnson@company.com"
}The playground uses json-forgefy 4.0.0 with 77 MongoDB-style operators across 8 categories:
$add, $subtract, $multiply, $divide, $abs, $ceil, $floor, $max, $min, $mod, $pow, $sqrt, $round, $toFixed, $trunc
$concat, $toUpper, $toLower, $substr, $slice, $split, $trim, $ltrim, $rtrim, $replace, $replaceOne, $replaceAll, $regexReplace, $size, $indexOf
$eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $regex
$and, $or, $not, $none
$cond, $switch, $ifNull, $coalesce, $some, $every
$filter, $map, $reduce, $sum, $avg, $arrayAt, $arrayFirst, $arrayLast
$type, $toString, $toNumber, $toDate, $exists, $isNull, $isNumber, $isNaN, $isString, $isBoolean, $isArray, $isDate
$addDays, $dateDiff, $dateShift, $dayOfMonth, $dayOfWeek, $dayOfYear, $isWeekend, $isHoliday
Complete documentation with examples β
The playground documentation is kept in sync with GUIDE.md:
- Update GUIDE.md in the project root with new operators or changes
- Run build:api in the playground directory:
cd playground && pnpm run build:api
- Commit changes including the updated
api-reference-data.js
Important: Always use GUIDE.md as the single source of truth for operator documentation.
The playground uses a beautiful Material Oceanic theme by default (dark), with an optional Dreamweaver Light mode. Your preference is saved automatically. The editor uses Menlo font for optimal code readability.
Found a bug or have a feature request?
- Check the issues page
- Create a new issue if needed
- Or submit a pull request!
ISC License - see LICENSE
- Library: json-forgefy
- Theme: Material Oceanic (dark) and Dreamweaver Light
- Built by: Daniel Marinho
Made with β€οΈ for the developer community