Skip to content

ZLib port for JavaScript, compiled to Luau (supporting roblox-ts)

License

Notifications You must be signed in to change notification settings

0x5eal/rbxts-pako

Repository files navigation

pako-roblox-ts

Fork of pako for Roblox-TS.

Installation

Supported as a pesde (Luau) package and npm (roblox-ts) package:

# pesde
pesde add 0x5eal/pako

# roblox-ts
npm add @rbxts/pako

Usage

Luau

local serde = require("@lune/serde")
local pako = require("./luau_packages/pako")

local test = { my = "super", puper = { 456, 567 }, awesome = "pako" }
local compressed = pako.deflate(serde.encode("json", test))
local restored = serde.decode(pako.inflate(compressed, { to = "string" }))

roblox-ts

import pako from "@rbxts/pako";

const test = { my: "super", puper: [456, 567], awesome: "pako" };
const compressed = pako.deflate(JSON.stringify(test));
const restored = JSON.parse(pako.inflate(compressed, { to: "string" }));

About

ZLib port for JavaScript, compiled to Luau (supporting roblox-ts)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published