{"versions":{"2.0.0":{"name":"@fregante/relaxed-json","description":"Relaxed JSON is strict superset JSON, relaxing strictness of valilla JSON","version":"2.0.0","homepage":"https://github.com/fregante/relaxed-json","author":{"name":"Oleg Grenrus","email":"oleg.grenrus@iki.fi","url":"http://oleg.fi/"},"repository":{"type":"git","url":"git://github.com/fregante/relaxed-json.git"},"bugs":{"url":"https://github.com/fregante/relaxed-json/issues"},"license":"BSD-3-Clause","main":"relaxed-json.js","engines":{"node":">= 0.10.0"},"scripts":{"test":"make"},"devDependencies":{"david":"^11.0.0","eslint":"^5.15.0","nyc":"^13.3.0","jsverify":"^0.8.4","mocha":"^6.0.2","uglify-js":"^3.4.9","underscore":"^1.8.2","typify-bin":"0.0.7"},"keywords":["json","comments","comment","config"],"_id":"@fregante/relaxed-json@2.0.0","gitHead":"d21e192af0352469cd4d7ebcdc7e9cd93fcd3989","_nodeVersion":"22.6.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-PyUXQWB42s4jBli435TDiYuVsadwRHnMc27YaLouINktvTWsL3FcKrRMGawTayFk46X+n5bE23RjUTWQwrukWw==","shasum":"c0ae5103a5473fb5dd54931107e35129351e527a","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@fregante/relaxed-json/-/relaxed-json-2.0.0.tgz","fileCount":6,"unpackedSize":47671,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDjOqZ+JDIpHf68Kzb61tnbnchXEslMaDk6wrM0g9G5YAiEApHbj0uDGhJaWv8v025MDa458OvnhmTlsjLYR7GyZ4wg="}],"size":12660},"_npmUser":{"name":"anonymous","email":"opensource@bfred.it"},"directories":{},"maintainers":[{"name":"anonymous","email":"opensource@bfred.it"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/relaxed-json_2.0.0_1724590666763_0.592819152762557"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-08-25T12:57:46.964Z","publish_time":1724590666964,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"2.0.0"},"name":"@fregante/relaxed-json","time":{"created":"2024-08-25T13:10:59.907Z","modified":"2024-08-25T13:11:00.432Z","2.0.0":"2024-08-25T12:57:46.964Z"},"readme":"# Fork of [Relaxed JSON](https://github.com/phadej/relaxed-json/fork) without CLI\n\n```sh\nnpm install @fregante/relaxed-json\n```\n\n```js\nconst RJSON = require('@fregante/relaxed-json');\nRJSON.transform('{ \"foo\": \"bar\" }');\n// => '{\"foo\":\"bar\"}'\n\nRJSON.parse('{ \"foo\": \"bar\" }');\n// => { foo: 'bar' }\n\nRJSON.stringify({ foo: 'bar' });\n// => '{\"foo\":\"bar\"}'\n```\n\n# Relaxed JSON\n\n[![NPM version](https://badge.fury.io/js/relaxed-json.svg)](http://badge.fury.io/js/relaxed-json)\n\nAre you frustrated that you cannot add comments into your configuration JSON\nRelaxed JSON is a simple solution.\nSmall JavaScript library with only one exposed function `RJSON.transform(text : string) : string`\n(and few convenient helpers).\n\n[Relaxed JSON](http://oleg.fi/relaxed-json) (modified BSD license) is a strict superset of JSON,\nrelaxing strictness of vanilla JSON.\nValid, vanilla JSON will not be changed by `RJSON.transform`. But there are few additional\nfeatures helping writing JSON by hand.\n\n* Comments are stripped : `// foo` and `/* bar */`  → `     `.\n  Comments are converted into whitespace, so your formatting is preserved.\n* Trailing comma is allowed : `[1, 2, 3, ]` → `[1, 2, 3]`. Works also in objects `{ \"foo\": \"bar\", }` → `{ \"foo\": \"bar\" }`.\n* Identifiers are transformed into strings : `{ foo: bar }` → `{ \"foo\": \"bar\" }`.\n* Single quoted strings are allowed : `'say \"Hello\"'` → `\"say \\\"Hello\\\"\"`.\n* More different characters is supported in identifiers: `foo-bar` → `\"foo-bar\"`.\n\n## API\n\n- `RJSON.transform(text : string) : string`.\n  Transforms Relaxed JSON text into JSON text. Doesn't verify (parse) the JSON, i.e result JSON might be invalid as well\n- `RJSON.parse(text : string, reviver : function | opts : obj) : obj`.\n  Parse the RJSON text, virtually `JSON.parse(JSON.transform(text), reviver)`.\n  You could pass a reviver function or an options object as the second argument. Supported options:\n  - `reviver`: you could still pass a reviver\n  - `relaxed`: use relaxed version of JSON (default: true)\n  - `warnings`: use relaxed JSON own parser, supports better error messages (default: false)\n  - `tolerant`: wait until the end to throw errors\n  - `duplicate`: fail if there are duplicate keys in objects\n\n## Changelog\n\n- 2.0.0 &mdash; 2024-08-25 &mdash; Dropped CLI\n- 1.0.1 &mdash; 2017-03-08 &mdash; Meteor compatibility\n  - [#9](https://github.com/fregante/relaxed-json/issues/9)\n    [#14](https://github.com/fregante/relaxed-json/pull/14)\n    [#15](https://github.com/fregante/relaxed-json/pull/15)\n- 1.0.0 &mdash; 2015-07-13 &mdash; Stable release\n  - Forward slashes bug fixed\n- 0.2.9 Dependencies bump\n- 0.2.8 Dev dependencies update\n- 0.2.7 `rjson` executable\n  - also depedencies update\n  - jscs style check\n- 0.2.6 Dependencies update\n- 0.2.5 Use `make`\n- 0.2.4 Maintenance release\n- 0.2.3 Bugfixes\n  - `$` is valid identifier character\n  - single line comments may end with `CR` and `CRLF` also\n- 0.2.2 Bugfix\n- 0.2.1 Code reogranization\n  - More though into toleration, handles valid json without colons and commas\n  - trailing comma stripping is more strict\n- 0.2.0 Shiny new features\n  - overloaded `rjson.parse`\n  - tolerating parser support\n  - duplicate key warning\n  - test suite (!)\n- 0.1.1 RJSON.parse\n- 0.1.0 Initial release\n\n## Related projects\n\n- [strip-json-comments](https://www.npmjs.org/package/strip-json-comments)\n\nFor truly human writable configuration consider using [YAML](http://yaml.org/).\n\n- [js-yaml](https://www.npmjs.com/package/js-yaml)","users":{}}