{"id":20537040,"url":"https://github.com/cvik/lejson","last_synced_at":"2025-04-14T07:22:26.914Z","repository":{"id":17632404,"uuid":"20436720","full_name":"cvik/lejson","owner":"cvik","description":"Le'Json - Lightweight Erlang Json library","archived":false,"fork":false,"pushed_at":"2022-06-28T00:13:28.000Z","size":75,"stargazers_count":1,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T13:12:42.671Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cvik.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-03T09:22:47.000Z","updated_at":"2022-06-28T00:13:30.000Z","dependencies_parsed_at":"2022-09-12T02:30:58.030Z","dependency_job_id":null,"html_url":"https://github.com/cvik/lejson","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvik%2Flejson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvik%2Flejson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvik%2Flejson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cvik%2Flejson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cvik","download_url":"https://codeload.github.com/cvik/lejson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837339,"owners_count":21169414,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T00:38:43.086Z","updated_at":"2025-04-14T07:22:26.886Z","avatar_url":"https://github.com/cvik.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Le'Json - Lightweight Erlang Json library\n\nRequires R17 since it produces maps on decode. Not yet handling unicode\ncode points like \"\\\\uD8B3\" (arabic) correctly. Other than that it seem\nto keep with the standard (rfc4627). Encoding is also compatible with rfc8259.\n\n## Exports\n\n```erlang\n-type json_key()    :: atom() | string() | binary().\n-type json_value()  :: boolean() | 'null' | calendar:datetime() | atom()\n                     | number() | binary() | json_object() | json_array().\n-type json_object() :: #{json_key() =\u003e json_value()}.\n-type json_array()  :: [json_value()].\n-type json_opts()   :: #{'keys' =\u003e 'atom' | 'existing_atom' | 'list'}.\n\n-spec lejson:decode(iodata()) -\u003e json_object() | json_array() | {error, not_json}.\n-spec lejson:decode(iodata(), json_opts()) -\u003e\n                    json_object() | json_array() | {error, not_json}.\n\n-spec lejson:encode(json_value()) -\u003e binary().\n```\n\n## Example usage\n\n```erlang\n1\u003e l(lejson).\nok\n2\u003e M = lejson:decode(\u003c\u003c\"{\\\"boolean\\\": [true, false],\n                         \\\"neg_num\\\": -12,\n                         \\\"floats\\\": [-22.3, -22.3e-12, 22.3E-12,\n                                      22.3E+4, 22.3E+4, 22.3E4],\n                         \\\"null\\\": null,\n                         \\\"pos_int\\\": 6789,\n                         \\\"string_value\\\": \\\"value\\\",\n                         \\\"utf_value\\\": \\\"\\\\uC3B8 and \\\\uc2a9\\\",\n                         \\\"arabic\\\": \\\"\\\\uD8B3\\\\ud8b5\\\\ud8b8\\\",\n                         \\\"more unicode\\\": \\\" \\\\uD834 \\\\uDD1E \\\",\n                         \\\"array\\\": [{\\\"object_inside_array\\\": 1}],\n                         \\\"nested_array\\\": [[[79]]],\n                         \\\"another_array\\\": [1,2,3,[1,[2],3],12]}\"\u003e\u003e).\n#{\u003c\u003c\"another_array\"\u003e\u003e =\u003e [1,2,3,[1,[2],3],12],\n  \u003c\u003c\"arabic\"\u003e\u003e =\u003e \u003c\u003c216,179,216,181,216,184\u003e\u003e,\n  \u003c\u003c\"array\"\u003e\u003e =\u003e [#{\u003c\u003c\"object_inside_array\"\u003e\u003e =\u003e 1}],\n  \u003c\u003c\"boolean\"\u003e\u003e =\u003e [true,false],\n  \u003c\u003c\"floats\"\u003e\u003e =\u003e [-22.3,-2.23e-11,2.23e-11,2.23e5,2.23e5,2.23e5],\n  \u003c\u003c\"more unicode\"\u003e\u003e =\u003e \u003c\u003c32,216,52,32,221,30,32\u003e\u003e,\n  \u003c\u003c\"neg_num\"\u003e\u003e =\u003e -12,\n  \u003c\u003c\"nested_array\"\u003e\u003e =\u003e [[\"O\"]],\n  \u003c\u003c\"null\"\u003e\u003e =\u003e null,\n  \u003c\u003c\"pos_int\"\u003e\u003e =\u003e 6789,\n  \u003c\u003c\"string_value\"\u003e\u003e =\u003e \u003c\u003c\"value\"\u003e\u003e,\n  \u003c\u003c\"utf_value\"\u003e\u003e =\u003e \u003c\u003c\"ø and ©\"/utf8\u003e\u003e}\n3\u003e lejson:encode(M)\n\u003c\u003c\"{\\\"another_array\\\": [1, 2, 3, [1, [2], 3], 12],\\\"arabic\\\": \\\"\"...\u003e\u003e\n```\n\n## License\n\nApache license version 2.0. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvik%2Flejson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcvik%2Flejson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcvik%2Flejson/lists"}