{"_id":"@bybrave/json5","_rev":"2-dcbb661854f5f1d2b6c269eb4bc99705","name":"@bybrave/json5","dist-tags":{"latest":"3.1.0"},"versions":{"3.0.0":{"name":"@bybrave/json5","version":"3.0.0","keywords":["json5","json","parser","stringify","es5","esm","config","configuration","typescript"],"author":{"url":"https://github.com/bybraveHQ","name":"bybrave"},"license":"MIT","_id":"@bybrave/json5@3.0.0","maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"contributors":[{"url":"author of the original json5","name":"Aseem Kishore"},{"name":"Jordan Tucker"}],"homepage":"https://github.com/bybraveHQ/json5#readme","bugs":{"url":"https://github.com/bybraveHQ/json5/issues"},"bin":{"json5":"lib/cli.js"},"dist":{"shasum":"c0b0e4f9c39fe7b176ddb567960096bf9e9be395","tarball":"https://registry.npmjs.org/@bybrave/json5/-/json5-3.0.0.tgz","fileCount":14,"integrity":"sha512-0eagkEU613t5o9dv6kDvcna8/q60mmXD8CY0/cv8bs3DcyoUBivPC33NZYxFHR3AOP7czDOCb+iMaj1IA/I43A==","signatures":[{"sig":"MEYCIQDrHFGKIU312/nIVHjHt8/n4kTmA6Rmc0TQNzlIwjeShgIhAKqvAO/wYjJtbpSUIiBAR87bY6qw0hpINKGMmvzfCs9G","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":126334},"main":"./dist/index.cjs","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./dist/index.cjs"},"./register":"./lib/register.cjs","./package.json":"./package.json"},"funding":"https://ko-fi.com/bybrave","gitHead":"69a52a774e0e8a9c57cfb131e85146b19e7a290e","scripts":{"test":"node --test test/*.test.js","build":"node build/build.js","test-types":"tsc --noEmit --strict test/type-declarations.ts","prepublishOnly":"npm run build"},"_npmUser":{"name":"bybrave","email":"opmybrave@gmail.com"},"repository":{"url":"git+https://github.com/bybraveHQ/json5.git","type":"git"},"_npmVersion":"10.8.2","description":"Maintained fork of json5 — the JSON5 parser/stringifier with fixed dual ESM/CJS exports (named exports match, #240/#348), esbuild build, and bundled TypeScript types","directories":{},"_nodeVersion":"20.19.6","_hasShrinkwrap":false,"devDependencies":{"esbuild":"^0.23.0","typescript":"^5.5.0","@types/node":"^20.14.0"},"_npmOperationalInternal":{"tmp":"tmp/json5_3.0.0_1783246033162_0.9346766118757188","host":"s3://npm-registry-packages-npm-production"}},"3.1.0":{"name":"@bybrave/json5","version":"3.1.0","description":"Maintained fork of json5 — the JSON5 parser/stringifier with fixed dual ESM/CJS exports (named exports match, #240/#348), esbuild build, and bundled TypeScript types","type":"module","main":"./dist/index.cjs","module":"./lib/index.js","types":"./lib/index.d.ts","exports":{".":{"types":"./lib/index.d.ts","import":"./lib/index.js","require":"./dist/index.cjs"},"./register":"./lib/register.cjs","./package.json":"./package.json"},"bin":{"json5":"lib/cli.js"},"scripts":{"build":"node build/build.js","test":"node --test test/*.test.js","test-types":"tsc --noEmit --strict test/type-declarations.ts","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/json5.git"},"bugs":{"url":"https://github.com/bybraveHQ/json5/issues"},"homepage":"https://github.com/bybraveHQ/json5#readme","keywords":["json5","json","parser","stringify","es5","esm","config","configuration","typescript"],"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"contributors":[{"name":"Aseem Kishore","url":"author of the original json5"},{"name":"Jordan Tucker"}],"license":"MIT","funding":"https://ko-fi.com/bybrave","engines":{"node":">=18"},"devDependencies":{"@types/node":"^20.14.0","esbuild":"^0.23.0","typescript":"^5.5.0"},"_id":"@bybrave/json5@3.1.0","gitHead":"68086aa5b49c8f16b90bf1f34a416d358b5dbdb5","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-fTLhovUS7zSnp7JTsqfeHhEEA4wFMGdeTmoMdTgknIXRQAkg81yW5jz4DmrIPZwETV88jMCrv3zLM1HLis4TnQ==","shasum":"39084ccb5f490d22a173b6bb64c1a6da17e15ae5","tarball":"https://registry.npmjs.org/@bybrave/json5/-/json5-3.1.0.tgz","fileCount":14,"unpackedSize":131584,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHxHYdCM5SRSWIhTJmjkhKjx+vnKxWx5qGcqhDUjGfcTAiEA0IKBWe/yKIRSLRF3w6PcgchW+OsL6kMR+qEwp/jIOIE="}]},"_npmUser":{"name":"bybrave","email":"opmybrave@gmail.com"},"directories":{},"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/json5_3.1.0_1783247103648_0.4127329244536426"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-05T10:07:12.959Z","modified":"2026-07-05T10:25:03.903Z","3.0.0":"2026-07-05T10:07:13.321Z","3.1.0":"2026-07-05T10:25:03.780Z"},"bugs":{"url":"https://github.com/bybraveHQ/json5/issues"},"author":{"name":"bybrave","url":"https://github.com/bybraveHQ"},"license":"MIT","homepage":"https://github.com/bybraveHQ/json5#readme","keywords":["json5","json","parser","stringify","es5","esm","config","configuration","typescript"],"repository":{"type":"git","url":"git+https://github.com/bybraveHQ/json5.git"},"description":"Maintained fork of json5 — the JSON5 parser/stringifier with fixed dual ESM/CJS exports (named exports match, #240/#348), esbuild build, and bundled TypeScript types","contributors":[{"name":"Aseem Kishore","url":"author of the original json5"},{"name":"Jordan Tucker"}],"maintainers":[{"name":"bybrave","email":"opmybrave@gmail.com"}],"readme":"# @bybrave/json5\n\nMaintained, drop-in fork of [`json5`](https://github.com/json5/json5) — the JSON5 (JSON for humans) parser and stringifier: comments, unquoted keys, trailing commas, single quotes, hex, and more.\n\nThe original has had no release since 2022 (`2.2.3`) while still pulling ~800M downloads/month. This fork keeps the parser 100% compatible and fixes the long-standing ESM packaging bug, modernizes the build, and bundles TypeScript types.\n\n```sh\nnpm install @bybrave/json5\n```\n\n```js\nconst JSON5 = require('@bybrave/json5');        // CommonJS\nimport JSON5 from '@bybrave/json5';              // ESM (default)\nimport { parse, stringify } from '@bybrave/json5'; // ESM (named) — now works\n```\n\nSame API as `json5`: `JSON5.parse(text, reviver?)` and `JSON5.stringify(value, replacer?, space?)`.\n\n## What's fixed\n\n| Issue | Problem | Fix |\n|---|---|---|\n| [#240](https://github.com/json5/json5/issues/240) | The ESM build (`module` field) exported only `{ default: {...} }` while CJS exported `{ parse, stringify }`. Bundlers that prefer `module` (webpack) broke on `import { parse }`, and `import`/`require` disagreed on shape. | ESM-first sources with an `exports` map: `import JSON5 from …`, `import { parse, stringify } from …`, and `require(…)` all resolve to the **same** shape. |\n| [#348](https://github.com/json5/json5/issues/348) | Request to ship real ES modules (tree-shaking, no CJS-interop shim). | Sources are ES modules; the CJS entry is generated from them via the `require` condition. |\n| [#205](https://github.com/json5/json5/issues/205) | Ask to drop the `minimist` CLI dependency. | Already resolved upstream (CLI uses a hand-rolled arg parser); this fork ships **zero runtime dependencies**. |\n\n## Modernized build\n\nThe original toolchain (rollup 0.64 + buble + core-js 2, 15 dev-dependencies) is replaced by a single **esbuild** step producing the CJS entry and a minified browser (UMD-style `window.JSON5`) bundle. Dev-dependencies drop to three (esbuild, typescript, @types/node). No runtime dependencies.\n\nTargets Node 18+. The browser bundle targets ES2015 (the original ES5 legacy target is dropped — a deliberate choice for a 2026 major).\n\n## Extras (opt-in)\n\n**Large integers (`bigint`)** — integer literals outside the safe range lose precision in `JSON.parse`/`json5`. Pass `{ bigint: true }` to get them back as `BigInt` ([#292](https://github.com/json5/json5/issues/292)); everything else is unchanged, and `stringify` serializes `BigInt` back to a bare literal:\n\n```js\nJSON5.parse('12345678901234567890');                 // 12345678901234567000  (imprecise)\nJSON5.parse('12345678901234567890', { bigint: true }); // 12345678901234567890n\nJSON5.stringify(99999999999999999999n);               // '99999999999999999999'\n```\n\nOptions may also be passed as the second argument: `JSON5.parse(text, { bigint: true })`.\n\n**Lone surrogates** — `stringify` now escapes unpaired surrogate code units as `\\uXXXX` instead of emitting an invalid string that reads back as `U+FFFD` ([#192](https://github.com/json5/json5/issues/192)). Valid surrogate pairs (emoji, etc.) are untouched.\n\n## Migration from `json5`\n\nReplace the dependency and the import — the parser and stringifier behave identically. The only change is packaging: `import { parse, stringify }` now works, and the `import`/`require` shapes match. If you consumed the deprecated `json5/register` require-hook, it moved to `@bybrave/json5/register`.\n\n## Support\n\nIf this package saves you time, you can support maintenance:\n\n[![Ko-fi](https://img.shields.io/badge/Ko--fi-buy%20me%20a%20coffee-FF5E5B?logo=kofi&logoColor=white)](https://ko-fi.com/bybrave)\n[![Bitcoin](https://img.shields.io/badge/Bitcoin-BTC-F7931A?logo=bitcoin&logoColor=white)](#support)\n\nBitcoin (BTC): `bc1q37557q5jpeaxqydzwvf3jgj7zhnfpn2td3q40q`\n\n## Credits & license\n\nMIT, same as the original — see [LICENSE.md](./LICENSE.md).\nBased on [json5](https://github.com/json5/json5) by Aseem Kishore, Jordan Tucker and contributors.\n","readmeFilename":"README.md"}