{"id":16040829,"url":"https://github.com/eliot-akira/base64-compressor","last_synced_at":"2025-03-17T21:31:04.085Z","repository":{"id":187753371,"uuid":"677584908","full_name":"eliot-akira/base64-compressor","owner":"eliot-akira","description":"Compress and encode data as URL-safe base64 string","archived":false,"fork":false,"pushed_at":"2024-01-14T16:52:04.000Z","size":188,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T04:45:07.962Z","etag":null,"topics":["base64","base64url","compression-stream","gzip","url"],"latest_commit_sha":null,"homepage":"https://eliot-akira.github.io/base64-compressor/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eliot-akira.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":"2023-08-12T01:16:33.000Z","updated_at":"2024-08-11T10:34:23.000Z","dependencies_parsed_at":"2023-08-12T03:12:47.026Z","dependency_job_id":"c7071028-aa0b-4936-b6bb-4fa3bcf6869a","html_url":"https://github.com/eliot-akira/base64-compressor","commit_stats":null,"previous_names":["eliot-akira/base64-compressor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliot-akira%2Fbase64-compressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliot-akira%2Fbase64-compressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliot-akira%2Fbase64-compressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eliot-akira%2Fbase64-compressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eliot-akira","download_url":"https://codeload.github.com/eliot-akira/base64-compressor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243885926,"owners_count":20363644,"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":["base64","base64url","compression-stream","gzip","url"],"created_at":"2024-10-08T23:21:44.326Z","updated_at":"2025-03-17T21:31:03.830Z","avatar_url":"https://github.com/eliot-akira.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Base64 Compressor\n\n\u003e Compress and encode data as URL-safe base64 string\n\n![Screenshot](screenshot.jpg)\n\n## Why\n\nIt can be useful to encode data, such as application state or binary file, into a string that is compressed and safe to use in URL query string or hash, as well as in JSON.\n\n## How\n\nFor `gzip` compression and decompression, it uses the [Compression Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API), well-supported by browsers and on server side.\n\nBinary to text encoding is done according to the specification for [Base 64 Encoding with URL and Filename Safe Alphabet](https://datatracker.ietf.org/doc/html/rfc4648#section-5).\n\n## Install\n\n```sh\nnpm install --save base64-compressor\n```\n\n## Usage\n\nEncode/decode JSON-serializable JavaScript value\n\n```ts\nimport { encode, decode } from 'base64-compressor'\n\nconst object = {\n  key: 'value'\n}\n\nconst base64string = await encode(object)\nconst decoded =  await decode(base64string)\n\nassert.deepEqual(decoded, object)\n```\n\nEncode/decode binary (array buffer)\n\n```ts\nimport { encodeBinary, decodeBinary } from 'base64-compressor'\n\nconst buffer = new ArrayBuffer(8)\n\nconst base64string = await encodeBinary(buffer)\nconst decoded =  await decodeBinary(base64string)\n\nassert.deepEqual(decoded, buffer)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliot-akira%2Fbase64-compressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feliot-akira%2Fbase64-compressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feliot-akira%2Fbase64-compressor/lists"}