{"id":13897594,"url":"https://github.com/Joakker/lua-json5","last_synced_at":"2025-07-17T14:32:21.074Z","repository":{"id":91976449,"uuid":"399555362","full_name":"Joakker/lua-json5","owner":"Joakker","description":"A json5 parser for luajit","archived":false,"fork":false,"pushed_at":"2025-07-12T23:19:31.000Z","size":31,"stargazers_count":38,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-13T01:14:51.170Z","etag":null,"topics":["json5-parser","lua","neovim"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joakker.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-08-24T17:44:53.000Z","updated_at":"2025-07-12T23:19:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3e92a0a-b798-487a-a5e5-462d694a4686","html_url":"https://github.com/Joakker/lua-json5","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Joakker/lua-json5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joakker%2Flua-json5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joakker%2Flua-json5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joakker%2Flua-json5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joakker%2Flua-json5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joakker","download_url":"https://codeload.github.com/Joakker/lua-json5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joakker%2Flua-json5/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265616802,"owners_count":23798901,"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":["json5-parser","lua","neovim"],"created_at":"2024-08-06T18:03:43.748Z","updated_at":"2025-07-17T14:32:21.069Z","avatar_url":"https://github.com/Joakker.png","language":"Rust","readme":"# Json5 parser for luajit\n\nThis crate provides json5 deserialization for luajit.\n\nInspired and adapted from [json5-rs](https://github.com/callum-oakley/json5-rs)\n\nAlso, if you haven't already, add ';?.dylib' to your `package.cpath` so it will\nbe recognized by the interpreter.\n\n## Usage\n\nYou can simply require the module in your scripts and parse a string using the\n`parse` method:\n\n```lua\nlocal parse = require'json5'.parse\nlocal data = [[\n{\n    /* This is a comment */\n    ecma_identifier: 'works like a charm',\n    \"string keys\": [1,2,3], // trailing comma\n}\n]]\nlocal parsed_data = parse(data)\n```\n\n## Use with neovim\n\nYou must have `cargo` installed and in your `$PATH`\n\nUsing [packer.nvim](https://github.com/wbthomason/packer.nvim):\n\n```lua\nuse {\n    'Joakker/lua-json5',\n    -- if you're on windows\n    -- run = 'powershell ./install.ps1'\n    run = './install.sh'\n}\n```\n\nUsing [lazy.nvim](https://github.com/folke/lazy.nvim.git)\n\n```lua\n{ \n    'Joakker/lua-json5',\n    build = './install.sh',\n}\n```\n\n## Performance\n\nTested on neovim using the following script:\n\n```lua\nlocal data = [[ {\"hello\":\"world\"} ]]\nlocal json5 = require('json5').parse\nlocal json_decode = vim.fn.json_decode\n\nlocal time_json5, time_json_decode = 0, 0\n\nlocal aux\n\nfor _ = 1, 1000 do\n    aux = os.clock()\n    json5(data)\n    time_json5 = time_json5 + (os.clock() - aux)\nend\n\nfor _ = 1, 1000 do\n    aux = os.clock()\n    json_decode(data)\n    time_json_decode = time_json_decode + (os.clock() - aux)\nend\n\nprint(('json5:        %.3fms'):format(time_json5))\nprint(('json_decode:  %.3fms'):format(time_json_decode))\n```\n\nOn average:\n```\njson5:        0.023ms\njson_decode:  0.010ms\n```\n\n## So, why should I use this instead of the builtin `json_decode`?\n\nIf performance is your concern, I think you're better off using the builtin\nfunction `json_decode`. The advantage this package has over regular json,\nhowever, is that you get json5 features, such as comments, trailing commas and\nmore flexible string literals.\n","funding_links":[],"categories":["Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJoakker%2Flua-json5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJoakker%2Flua-json5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJoakker%2Flua-json5/lists"}