A superset of JSON that adds ES6 syntax features like comments, trailing commas, and unquoted keys for human-friendly data files.
JSON6 is a JavaScript library that extends the JSON format with ES6-inspired syntax features to make it more human-friendly. It allows developers to write JSON-like data with comments, unquoted keys, trailing commas, multiline strings, and additional number formats while remaining fully compatible with standard JSON. It solves the problem of JSON being cumbersome to write and maintain by hand for configurations, manifests, and other human-edited data files.
Developers working with configuration files, build manifests, test data, or any JSON-based data that needs to be readable and editable by humans. It's particularly useful for Node.js and frontend projects where JSON is used for settings or data serialization.
JSON6 offers a lightweight, backward-compatible extension to JSON that dramatically improves readability and writability without requiring a switch to a completely different format like YAML. Its streaming parser and performance optimizations make it a practical choice for both small configs and large data streams.
JSON for Humans (ES6)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports comments, unquoted keys, and trailing commas, making configuration files easier to write and maintain by hand, as shown in the README's package.JSON6 example.
Adds modern JavaScript features like multiline strings, backtick quotes, and numeric separators, allowing developers to use familiar ES6 conventions in data files.
Provides a streaming interface via JSON6.begin() for incremental parsing of large or continuous data, useful for real-time applications like log processing.
Fully parses standard JSON content while extending it, ensuring seamless adoption in existing projects without breaking current data.
Falls back to JSON.stringify for serialization, which cannot handle JSON6-specific values like undefined or special numbers, breaking round-trip data consistency.
Uses a .json6 extension and lacks official standardization, leading to compatibility issues with tools and parsers that only support JSON or other established formats.
Additional syntax like underscore separators and empty array elements can introduce subtle bugs, as noted in the README's caveats about error handling and streaming.