{"id":26475754,"url":"https://github.com/glitchybyte/zappy","last_synced_at":"2026-04-16T15:01:49.171Z","repository":{"id":239677559,"uuid":"800231376","full_name":"GlitchyByte/zappy","owner":"GlitchyByte","description":"Library for compressing and encoding JSON payloads into Base64Url for efficient transport.","archived":false,"fork":false,"pushed_at":"2025-07-09T21:50:16.000Z","size":448,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-23T19:57:04.919Z","etag":null,"topics":["base64","compression","json","npm-package","text","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GlitchyByte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["GlitchyByte"],"custom":["https://paypal.me/GlitchyByte"]}},"created_at":"2024-05-14T00:17:20.000Z","updated_at":"2025-07-09T21:49:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"dd6e7d18-fd4e-417d-a62b-dd1e345abda0","html_url":"https://github.com/GlitchyByte/zappy","commit_stats":null,"previous_names":["glitchybyte/zappy"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/GlitchyByte/zappy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlitchyByte%2Fzappy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlitchyByte%2Fzappy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlitchyByte%2Fzappy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlitchyByte%2Fzappy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GlitchyByte","download_url":"https://codeload.github.com/GlitchyByte/zappy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlitchyByte%2Fzappy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31891038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["base64","compression","json","npm-package","text","typescript"],"created_at":"2025-03-19T23:45:05.990Z","updated_at":"2026-04-16T15:01:49.166Z","avatar_url":"https://github.com/GlitchyByte.png","language":"TypeScript","funding_links":["https://github.com/sponsors/GlitchyByte","https://paypal.me/GlitchyByte"],"categories":[],"sub_categories":[],"readme":"# Zappy\n\n[![version](https://img.shields.io/badge/version-3.0.0-dodgerblue)](https://github.com/GlitchyByte/zappy/releases/tag/v3.0.0)\n[![spec](https://img.shields.io/badge/spec-2.0.0-palegreen)](https://github.com/GlitchyByte/zappy/blob/v3.0.0/SPEC.md)\n\nLibrary for compressing and encoding JSON payloads into Base64Url\nfor efficient transport.\n\n[Read the spec here!](https://github.com/GlitchyByte/zappy/blob/v3.0.0/SPEC.md)\n\n#### Goals\n\n* Capable of encoding any valid utf-8 json string.\n* Transportable as URL-safe plain text.\n* Produce smaller encoded string than vanilla base64.\n* Fast encoding and decoding.\n\n#### Non-Goals\n\n* Encryption. This ain't it. It's obfuscation at best.\n* Compressing generic text. Though it may work, Zappy is designed for json.\n\n#### Notes\n\nFor non-trivial json payloads, testing has shown the resulting Zappy\nstring is **smaller than the original** json string! This wasn't a goal,\nbut it is a satisfying result and worth mentioning.\n\nZappy strings should not be stored. They are designed for transport\nwhere one side encodes before transmitting and the other side decodes\nafter receiving. If the spec changes between encoding and decoding,\nthe result will not be the original string.\n\n## API\n\n```ts\n// Encode and decode a Zappy string.\nfunction encodeStringToZappy(str: string): string\nfunction decodeZappyToString(str: string): string\n\n// Encode and decode a Base64Url string.\nfunction encodeStringToBase64(str: string): string\nfunction decodeBase64ToString(str: string): string\n\n// Encode and decode a DeflateRaw-Base64Url string.\nfunction encodeStringToDeflate(str: string): string\nfunction decodeDeflateToString(str: string): string\n```\n\n## How to use\n\n### Add package to your project\n\n```bash\nnpm install @glitchybyte/zappy\n```\n\n### Encode and decode in your code\n\n```ts\nimport {\n  encodeStringToBase64,\n  encodeStringToZappy,\n  decodeZappyToString\n} from \"@glitchybyte/zappy\"\n\nconst json = '{' +\n  '\"codeUrl\":\"https://github.com/glitchybyte/zappy\",' +\n  '\"msg\":\"When I deal with internationalization I think of defenestration.\"' +\n  '}'\nconst encoded = encodeStringToZappy(json)\nconsole.log(`[${encoded.length}] ${encoded}`)\n// [118] dNCI6JqpJjK8bWS7cjew_azBuwOvlztCH6-mpWznmzhrKb5l10AKQDQoPgAa\n//       XBCoA24Kh7e3aIAmcNuIXjFk4AKQDXpLESAE9GAN7BrqORuRrW4nTg52_A\n\n// While Base64Url is:\nconst base64Encoded = encodeStringToBase64(json)\nconsole.log(`[${base64Encoded.length}] ${base64Encoded}`)\n// [164] eyJjb2RlVXJsIjoiaHR0cHM6Ly9naXRodWIuY29tL2dsaXRjaHlieXRlL3ph\n//       cHB5IiwibXNnIjoiV2hlbiBJIGRlYWwgd2l0aCBpbnRlcm5hdGlvbmFsaXph\n//       dGlvbiBJIHRoaW5rIG9mIGRlZmVuZXN0cmF0aW9uLiJ9\n\nconst decoded = decodeZappyToString(encoded)\nconsole.log(`[${decoded.length}] ${decoded}`)\n// [123] {\"codeUrl\":\"https://github.com/glitchybyte/zappy\",\"msg\":\"Whe\n//       n I deal with internationalization I think of defenestration\n//       .\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglitchybyte%2Fzappy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglitchybyte%2Fzappy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglitchybyte%2Fzappy/lists"}