{"id":16690354,"url":"https://github.com/khvzak/lua-ryaml","last_synced_at":"2025-04-10T00:50:25.519Z","repository":{"id":96262221,"uuid":"359616860","full_name":"khvzak/lua-ryaml","owner":"khvzak","description":"A fast Lua YAML library written in Rust using serde","archived":false,"fork":false,"pushed_at":"2023-08-29T14:38:59.000Z","size":9,"stargazers_count":11,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T02:36:36.576Z","etag":null,"topics":["lua","rust","yaml"],"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/khvzak.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}},"created_at":"2021-04-19T22:39:43.000Z","updated_at":"2024-12-26T18:41:08.000Z","dependencies_parsed_at":"2025-02-16T05:33:26.926Z","dependency_job_id":"9c2b5afa-6191-488a-a540-e2b617e31fe9","html_url":"https://github.com/khvzak/lua-ryaml","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khvzak%2Flua-ryaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khvzak%2Flua-ryaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khvzak%2Flua-ryaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khvzak%2Flua-ryaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khvzak","download_url":"https://codeload.github.com/khvzak/lua-ryaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137997,"owners_count":21053775,"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":["lua","rust","yaml"],"created_at":"2024-10-12T15:51:23.157Z","updated_at":"2025-04-10T00:50:25.509Z","avatar_url":"https://github.com/khvzak.png","language":"Rust","readme":"# lua-ryaml\n![Build Status]\n\n[Build Status]: https://github.com/khvzak/lua-ryaml/workflows/CI/badge.svg\n\nA fast YAML library written in [Rust] for Lua using [serde-yaml].\n\nThanks to [mlua] library, it supports Lua 5.4/5.3/5.2/5.1 (including LuaJIT) without any effort.\n\n[Rust]: https://www.rust-lang.org\n[serde-yaml]: https://github.com/dtolnay/serde-yaml\n[mlua]: https://github.com/khvzak/mlua\n\n## Usage\n\n```lua\nlocal ryaml = require(\"ryaml\")\n\nlocal val = ryaml.decode(\"a: 1\")\nprint(ryaml.encode(val))\n-- Prints:\n-- ---\n-- a: 1\n\n-- Safe interface\nlocal ryaml_safe = require(\"ryaml.safe\")\n\nlocal t, err = ryaml_safe.decode(\"[\")\nassert(t == nil)\nprint(err)\n-- Prints:\n-- while parsing a node, did not find expected node content at line 2 column 1\n```\n\n#### `ryaml.decode`\n\nParses YAML document and returns a Lua value. Throws an exception in case of error.\n\nAlso available as `ryaml.load` (alias).\n\n#### `ryaml.encode`\n\nSerializes Lua value into a YAML document. Throws an exception in case of error.\n\nAlso available as `ryaml.dump` (alias).\n\n#### `ryaml.null`\n\nA lightuserdata, which will be encoded as a `NULL` value.\n\n```lua\nlocal t = {ryaml.null}\nprint(ryaml.encode(t))\n-- Prints:\n-- ---\n-- - ~\n```\n\n#### `ryaml.array_mt`\n\nTables with this metatable will be systematically encoded it as an Array.\n\n```lua\nlocal t = setmetatable({}, ryaml.array_mt)\nprint(ryaml.encode(t))\n-- Prints:\n-- ---\n-- []\n```\n\n### Safe interface\n\nThe `ryaml.safe` interface behaves identically to the `ryaml` module, except that `ryaml.decode`/`ryaml.encode` functions will return nil followed by the error message.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhvzak%2Flua-ryaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhvzak%2Flua-ryaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhvzak%2Flua-ryaml/lists"}