{"id":22963239,"url":"https://github.com/chadhyatt/LuaEncode","last_synced_at":"2025-08-13T07:34:34.160Z","repository":{"id":64422799,"uuid":"562575384","full_name":"regginator/LuaEncode","owner":"regginator","description":"Table Serialization Library for Pure Luau/Lua 5.1+","archived":false,"fork":false,"pushed_at":"2024-11-26T04:49:59.000Z","size":173,"stargazers_count":29,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-26T05:18:57.110Z","etag":null,"topics":["lua","luau","roblox","serialization"],"latest_commit_sha":null,"homepage":"https://latte.to","language":"Lua","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/regginator.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":"2022-11-06T19:08:23.000Z","updated_at":"2024-11-26T04:50:02.000Z","dependencies_parsed_at":"2024-11-26T05:18:53.663Z","dependency_job_id":"062f0c6c-ab93-4b8d-8a1c-01afb8cbc9ce","html_url":"https://github.com/regginator/LuaEncode","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regginator%2FLuaEncode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regginator%2FLuaEncode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regginator%2FLuaEncode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/regginator%2FLuaEncode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/regginator","download_url":"https://codeload.github.com/regginator/LuaEncode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229747405,"owners_count":18118050,"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","luau","roblox","serialization"],"created_at":"2024-12-14T19:33:22.864Z","updated_at":"2025-08-13T07:34:34.000Z","avatar_url":"https://github.com/regginator.png","language":"Lua","readme":"\u003c!-- Links --\u003e\n[latest-release]: https://github.com/chadhyatt/LuaEncode/releases/latest\n[license]: https://github.com/chadhyatt/LuaEncode/blob/master/LICENSE.txt\n[commits]: https://github.com/chadhyatt/LuaEncode/commits\n[wally]: https://wally.run/package/chadhyatt/luaencode\n\n[roblox-marketplace]: https://create.roblox.com/marketplace/asset/12791121865/LuaEncode\n\n\u003c!-- Badges --\u003e\n[badges/latest-release]: https://img.shields.io/github/v/release/chadhyatt/LuaEncode?label=Latest%20Release\n[badges/last-modified]: https://img.shields.io/github/last-commit/chadhyatt/LuaEncode?label=Last%20Modifed\n[badges/license]: https://img.shields.io/github/license/chadhyatt/LuaEncode?label=License\n[badges/wally]: https://img.shields.io/badge/wally.run-chadhyatt%2Fluaencode-%23ad4646?style=flat\"\n\n\u003c!-- Social icons --\u003e\n[social/roblox-marketplace]: gh-assets/roblox-marketplace-icon.svg\n\n# LuaEncode\n\nFast table serialization library for pure Luau/Lua 5.1+\n\n[![Latest Release][badges/latest-release]][latest-release] [![Last Modified][badges/last-modified]][commits] [![License][badges/license]][license] [![Wally][badges/wally]][wally]\n\n[![Roblox Marketplace][social/roblox-marketplace]][roblox-marketplace]\n\n___\n\n## 🎉 About\n\nLuaEncode is a simple library for serialization of Lua tables and basic data types, along with support for all of Roblox's engine data types. LuaEncode supports both Luau and Lua 5.1+\n\n### 🌟 Features\n\n* Serialization and output of basic types `number`, `string`, `table`, `boolean`, and `nil` for key/values\n* Pretty-printing and custom indentation configuration\n* Compatible with Roblox's engine data types (`Instance`, `UDim2`, `Vector3`, `DateTime`, etc..) - See **[Roblox Engine Data Type Coverage](#roblox-engine-data-type-coverage)** for more info\n* Secure table iteration and value reading, with potentially untrusted inputs in-mind\n* Manual cycle inserts in serialized codegen with [`InsertCycles`](#api)\n* Extended raw key/value inserts with [`FunctionsReturnRaw`](#api)\n\n___\n\n## ⚙️ Installation\n\n* ### Rojo/Wally\n\n    If you're using [Rojo](https://rojo.space) and [Wally](https://wally.run/), you can import the package in your `wally.toml`:\n\n    ```toml\n    LuaEncode = \"chadhyatt/luaencode@1.4.4\"\n    ```\n\n* ### Roblox Marketplace\n\n    You can also grab the LuaEncode module from the Roblox Marketplace: \u003chttps://roblox.com/library/12791121865\u003e\n\n___\n\n## 🚀 Basic Usage\n\n```lua\nlocal LuaEncode = require(\"path/to/LuaEncode\")\n\nlocal Table = {\n    foo = \"bar\",\n    baz = {\n        1,\n        2,\n        3,\n        [5] = 5,\n    },\n    qux = function()\n        return \"\\\"hi!\\\"\" -- With `FunctionsReturnRaw` set as true in options, this will output as 'qux = \"hi!\"'\n    end,\n}\n\nlocal Encoded = LuaEncode(Table, {\n    Prettify = true,\n    FunctionsReturnRaw = true,\n})\n\nprint(Encoded)\n```\n\n\u003cdetails open\u003e\n\u003csummary\u003eOutput\u003c/summary\u003e\n\u003cbr /\u003e\n\u003cul\u003e\n\n```lua\n{\n    qux = \"hi!\",\n    baz = {\n        1,\n        2,\n        3,\n        [5] = 5\n    },\n    foo = \"bar\"\n}\n```\n\n\u003c/ul\u003e\n\u003c/details\u003e\n\n___\n\n## 🔨 API\n\n```lua\nLuaEncode(inputTable: {[any]: any}, options: {[string]: any}): string\n```\n\n### Options\n\n| Argument           | Type                | Description                         |\n|:-------------------|:--------------------|:------------------------------------|\n| Prettify           | `\u003cboolean:false\u003e`  | Whether or not the output should be [pretty printed](https://en.wikipedia.org/wiki/Prettyprint#Programming_code_formatting) |\n| IndentCount        | `\u003cnumber:0\u003e`       | The amount of characters that should be used for indents (**Note**: If `Prettify` is set to true and this is unspecified, it will default to `4`) |\n| InsertCycles       | `\u003cboolean:false\u003e`  | If there are cyclic references in your table, the output will be wrapped in an anonymous function that manually sets paths to those references. (**NOTE:** If a key in the index path to the cycle is a reference type (e.g. `table`, `function`), the codegen can't externally set that path, and the value will have to be ignored) |\n| OutputWarnings     | `\u003cboolean:true\u003e`   | If \"warnings\" should be placed into the output as comment blocks |\n| FunctionsReturnRaw | `\u003cboolean:false\u003e`  | If `function` values should be treated as callbacks that return a string to be inserted directly into the serialized output as the key/value |\n| UseInstancePaths   | `\u003cboolean:true\u003e`  | If Roblox `Instance` values should return their Lua-accessable path for serialization. If the instance is parented under `nil` or isn't under `game`/`workspace`, it'll always fall back to `Instance.new(ClassName)` |\n| UseFindFirstChild  | `\u003cboolean:true\u003e`  | When `options.UseInstancePaths` is true, whether or not instance paths should use `FindFirstChild` instead of direct indexes |\n| SerializeMathHuge  | `\u003cboolean:true\u003e ` | If \"infinite\" (or negative-infinite) numbers should be serialized as `math.huge`. (uses the `math` global, as opposed to just a direct data type) If false, \"`1/0`\" or \"`-1/0`\" will be serialized, which is supported on all target Lua environments |\n\n___\n\n## Roblox Engine Data Type Coverage\n\n*(See [AllRobloxTypes.server.lua](tests/RobloxTests/AllRobloxTypes.server.lua) for example input and output of supported Roblox data types.)*\n\n✔ Implemented | ➖ Partially Implemented | ❌ Unimplemented | ⛔ Never\n\n| DataType                                                                                                      | Serialized As                                     | Implemented |\n|:--------------------------------------------------------------------------------------------------------------|:--------------------------------------------------|:-----------:|\n| [buffer](https://create.roblox.com/docs/reference/engine/libraries/buffer)                                    | `buffer.fromstring()`                             | ✔ |\n| [SharedTable](https://create.roblox.com/docs/reference/engine/libraries/SharedTable)                          | `SharedTable.new()`                               | ✔ |\n| [Axes](https://create.roblox.com/docs/reference/engine/datatypes/Axes)                                        | `Axes.new()`                                      | ✔ |\n| [BrickColor](https://create.roblox.com/docs/reference/engine/datatypes/BrickColor)                            | `BrickColor.new()`                                | ✔ |\n| [CFrame](https://create.roblox.com/docs/reference/engine/datatypes/CFrame)                                    | `CFrame.new()`                                    | ✔ |\n| [CatalogSearchParams](https://create.roblox.com/docs/reference/engine/datatypes/CatalogSearchParams)          | `CatalogSearchParams.new()`                       | ✔ |\n| [Color3](https://create.roblox.com/docs/reference/engine/datatypes/Color3)                                    | `Color3.new()`                                    | ✔ |\n| [ColorSequence](https://create.roblox.com/docs/reference/engine/datatypes/ColorSequence)                      | `ColorSequence.new(\u003cColorSequenceKeypoints\u003e)`     | ✔ |\n| [ColorSequenceKeypoint](https://create.roblox.com/docs/reference/engine/datatypes/ColorSequenceKeypoint)      | `ColorSequenceKeypoint.new()`                     | ✔ |\n| [DateTime](https://create.roblox.com/docs/reference/engine/datatypes/DateTime)                                | `DateTime.fromUnixTimestamp()`                    | ✔ |\n| [DockWidgetPluginGuiInfo](https://create.roblox.com/docs/reference/engine/datatypes/DockWidgetPluginGuiInfo)  | `DockWidgetPluginGuiInfo.new()`                   | ✔ |\n| [Enum](https://create.roblox.com/docs/reference/engine/datatypes/Enum)                                        | `Enum.\u003cEnumType\u003e`                                 | ✔ |\n| [EnumItem](https://create.roblox.com/docs/reference/engine/datatypes/EnumItem)                                | `Enum.\u003cEnumType\u003e.\u003cEnumItem\u003e`                      | ✔ |\n| [Enums](https://create.roblox.com/docs/reference/engine/datatypes/Enums)                                      | `Enum`                                            | ✔ |\n| [Faces](https://create.roblox.com/docs/reference/engine/datatypes/Faces)                                      | `Faces.new()`                                     | ✔ |\n| [FloatCurveKey](https://create.roblox.com/docs/reference/engine/datatypes/FloatCurveKey)                      | `FloatCurveKey.new()`                             | ✔ |\n| [Font](https://create.roblox.com/docs/reference/engine/datatypes/Font)                                        | `Font.new()`                                      | ✔ |\n| [Instance](https://create.roblox.com/docs/reference/engine/datatypes/Instance)                                | `Instance.new()`                                  | ✔ |\n| [NumberRange](https://create.roblox.com/docs/reference/engine/datatypes/NumberRange)                          | `NumberRange.new()`                               | ✔ |\n| [NumberSequence](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequence)                    | `NumberSequence.new(\u003cNumberSequenceKeypoints\u003e)`   | ✔ |\n| [NumberSequenceKeypoint](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequenceKeypoint)    | `NumberSequenceKeypoint.new()`                    | ✔ |\n| [OverlapParams](https://create.roblox.com/docs/reference/engine/datatypes/OverlapParams)                      | `OverlapParams.new()`                             | ✔ |\n| [Path2DControlPoint](https://create.roblox.com/docs/reference/engine/datatypes/Path2DControlPoint)            | `Path2DControlPoint.new()`                        | ✔ |\n| [PathWaypoint](https://create.roblox.com/docs/reference/engine/datatypes/PathWaypoint)                        | `PathWaypoint.new()`                              | ✔ |\n| [PhysicalProperties](https://create.roblox.com/docs/reference/engine/datatypes/PhysicalProperties)            | `PhysicalProperties.new()`                        | ✔ |\n| [RBXScriptConnection](https://create.roblox.com/docs/reference/engine/datatypes/RBXScriptConnection)          | `N/A`                                             | ⛔ |\n| [RBXScriptSignal](https://create.roblox.com/docs/reference/engine/datatypes/RBXScriptSignal)                  | `N/A`                                             | ⛔ |\n| [Random](https://create.roblox.com/docs/reference/engine/datatypes/Random)                                    | `Random.new()`                                    | ✔ |\n| [Ray](https://create.roblox.com/docs/reference/engine/datatypes/Ray#summary-constructors)                     | `Ray.new()`                                       | ✔ |\n| [RaycastParams](https://create.roblox.com/docs/reference/engine/datatypes/RaycastParams)                      | `RaycastParams.new()`                             | ✔ |\n| [RaycastResult](https://create.roblox.com/docs/reference/engine/datatypes/RaycastResult)                      | `N/A`                                             | ⛔ |\n| [Rect](https://create.roblox.com/docs/reference/engine/datatypes/Rect#summary-constructors)                   | `Rect.new()`                                      | ✔ |\n| [Region3](https://create.roblox.com/docs/reference/engine/datatypes/Region3)                                  | `Region3.new()`                                   | ✔ |\n| [Region3int16](https://create.roblox.com/docs/reference/engine/datatypes/Region3int16)                        | `Region3int16.new()`                              | ✔ |\n| [TweenInfo](https://create.roblox.com/docs/reference/engine/datatypes/TweenInfo)                              | `TweenInfo.new()`                                 | ✔ |\n| [RotationCurveKey](https://create.roblox.com/docs/reference/engine/datatypes/RotationCurveKey)                | `RotationCurveKey.new()`                          | ✔ |\n| [Secret](https://create.roblox.com/docs/reference/engine/datatypes/Secret)                                    | `N/A`                                             | ⛔ |\n| [UDim](https://create.roblox.com/docs/reference/engine/datatypes/UDim)                                        | `UDim.new()`                                      | ✔ |\n| [UDim2](https://create.roblox.com/docs/reference/engine/datatypes/UDim2)                                      | `UDim2.new()`                                     | ✔ |\n| [Vector2](https://create.roblox.com/docs/reference/engine/datatypes/Vector2)                                  | `Vector2.new()`                                   | ✔ |\n| [Vector2int16](https://create.roblox.com/docs/reference/engine/datatypes/Vector2int16)                        | `Vector2int16.new()`                              | ✔ |\n| [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)                                  | `Vector3.new()`                                   | ✔ |\n| [Vector3int16](https://create.roblox.com/docs/reference/engine/datatypes/Vector3int16)                        | `Vector3int16.new()`                              | ✔ |\n\n*(See official Roblox data type documentation [here](https://create.roblox.com/docs/reference/engine/datatypes))*\n\n___\n\n## 🏛️ License\n\n```\nMIT License\n\nCopyright (c) 2022-2025 Chad Hyatt \u003cchad@hyatt.page\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadhyatt%2FLuaEncode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchadhyatt%2FLuaEncode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadhyatt%2FLuaEncode/lists"}