{"id":"danielinator/typed-sera","name":"typed-sera","scope":"danielinator","platform":"roblox","description":"A sera rewrite with better typing, clean support for nesting (tables inside tables), and promises! <br/> Adds options to pack together booleans (compress multiple booleans into as little bytes as possible) and automatic compressing of buffers (if you want to make them even smaller, you can add this and immediately send the returned buffer accross the client-server boundary).","version":"1.0.5","latest":"1.0.5","versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5"],"license":"Apache-2.0","licenseRating":"safe","licenseCaveats":["Modified files must carry a notice of changes. If the package ships a NOTICE file, its attributions must be preserved.","License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{"howmanysmall/typed-promise":{"version":"^4.0.6","alias":"promise"},"osyrisrblx/t":{"version":"^3.1.1","alias":"t"}},"integrity":"124bd989444a46c71ed8df097f5dc0c1e35054abff4f0b720f8bd90b6a024503","likes":0,"downloads":0,"install":"forest install danielinator/typed-sera","url":"https://forest.dev/p/roblox/danielinator/typed-sera","files":"https://api.forest.dev/ai/package/roblox/danielinator/typed-sera/files","readme":"# Sera\r\nThis is a Low-level schematized serialization library for Roblox for handling limited size dictionaries with primitive types. This library aims to do as few operations (table lookups, comparisons, etc.) as possible to achieve it's result while staying a good-enough serialization library.\r\n\r\nSera's intended purpose is to help with serialization schemas when handling high-efficiency game entity replication to clients. Note that this is not a module for beginners and you should at least know the basics of using the [`buffer`](https://create.roblox.com/docs/reference/engine/libraries/buffer) class.\r\n\r\n## Perks:\r\n- Fast.\r\n- Efficient-enough representation of a dictionary inside a `buffer`.\r\n- `Sera.Serialize`, `Sera.Push`, `Sera.DeltaSerialize` and `Sera.DeltaPush` outputs can be combined inside a large buffer - `Sera.Deserialize` and `Sera.DeltaDeserialize` understand when an entry ends given a buffer and offset and returns a new offset for the developer to continue reading the buffer.\r\n- `Sera.DeltaSerialize` and `Sera.DeltaPush` treats a schema as an enumerator and serializes an incomplete dictionary with added (n + 1) bytes in the output where \"n\" is the number of fields present.\r\n\r\n## Limitations:\r\n- Schemas can only hold up to 255 fields in Sera and it's going to stay that way - you may fork the project and easily change this for yourself.\r\n- `Sera.Serialize` and `Sera.DeltaSerialize` will fail if resulting buffer size is larger than  the constant `BIG_BUFFER_SIZE` inside the `Sera` module - This value should be moderate, but within reason since that's the memory `Sera` will take and never release during runtime.\r\n\r\n[Source Code (Single ModuleScript)](https://github.com/MadStudioRoblox/Sera/blob/main/Sera.luau)\r\n\r\n[Longer Example Code](https://github.com/MadStudioRoblox/Sera/blob/main/Test.luau)\r\n\r\n[Join the discussion in the Roblox Developer Forum (click here)](https://devforum.roblox.com/t/sera-low-level-schematized-serialization-library/3304206)\r\n\r\n***This is an experimental project - there will be no guarantees for backwards-compatibility on further updates***\r\n\r\n## Short Example:\r\n\r\n```lua\r\n\r\nlocal Sera = require(game.ReplicatedStorage.Sera)\r\n\r\nlocal Schema = Sera.Schema({\r\n\tHealth = Sera.Int16,\r\n\tPosition = Sera.Vector3,\r\n\tName = Sera.String8,\r\n})\r\n\r\nlocal serialized, error_message = Sera.Serialize(Schema, {\r\n    Health = 150,\r\n    Position = Vector3.new(1001, 69, 0.1),\r\n    Name = \"loleris\",\r\n})\r\n\r\nif error_message ~= nil then\r\n    error(error_message)\r\nend\r\n\r\nlocal deserialized = Sera.Deserialize(Schema, serialized :: buffer)\r\n\r\nprint(`Serialized buffer size: {buffer.len(serialized :: buffer)} bytes`)\r\nprint(`Deserialized:`, deserialized)\r\n\r\n```","readmeTruncated":false}