{"id":15670759,"url":"https://github.com/hexagon/base64","last_synced_at":"2025-08-21T18:33:11.407Z","repository":{"id":37028532,"uuid":"442304403","full_name":"Hexagon/base64","owner":"Hexagon","description":"Base64 and base64url to string or arraybuffer, and back. Works in Node, Deno or browser.","archived":false,"fork":false,"pushed_at":"2024-10-18T20:06:27.000Z","size":1389,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-30T08:20:10.366Z","etag":null,"topics":["arraybuffer","base64","base64url","commonjs","deno","esm","esmodule","javascript","node","string","typescript","umd"],"latest_commit_sha":null,"homepage":"http://base64.56k.guru/","language":"TypeScript","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/Hexagon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["hexagon"],"ko_fi":"hexagon_56k"}},"created_at":"2021-12-28T00:15:37.000Z","updated_at":"2024-10-30T06:28:21.000Z","dependencies_parsed_at":"2023-02-18T10:18:18.226Z","dependency_job_id":"39012ed9-fb8c-45aa-b7ad-dc72fc6ea06e","html_url":"https://github.com/Hexagon/base64","commit_stats":{"total_commits":84,"total_committers":3,"mean_commits":28.0,"dds":0.0357142857142857,"last_synced_commit":"38d111158af41506ee6e05290de6939eb9ab34a1"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fbase64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fbase64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fbase64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fbase64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hexagon","download_url":"https://codeload.github.com/Hexagon/base64/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230527866,"owners_count":18240051,"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":["arraybuffer","base64","base64url","commonjs","deno","esm","esmodule","javascript","node","string","typescript","umd"],"created_at":"2024-10-03T15:01:00.984Z","updated_at":"2025-08-21T18:33:11.377Z","avatar_url":"https://github.com/Hexagon.png","language":"TypeScript","funding_links":["https://github.com/sponsors/hexagon","https://ko-fi.com/hexagon_56k"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/hexagon/base64@main/docs/base64.png\" alt=\"@hexagon/base64\" width=\"200\" height=\"200\"\u003e\u003cbr\u003e\n  \u003cbr\u003eProbably the only JavaScript base64 library you'll ever need!\u003cbr\u003e\n\u003c/p\u003e\n\n# @hexagon/base64\n\nEncode, decode and validate base64/base64url to string/arraybuffer and vice-versa. Works in Node, Deno and browser.\n\n[![CI](https://github.com/Hexagon/base64/actions/workflows/test.yml/badge.svg)](https://github.com/Hexagon/base64/actions/workflows/test.yml) \n[![npm version](https://badge.fury.io/js/@hexagon%2Fbase64.svg)](https://badge.fury.io/js/@hexagon%2Fbase64) [![NPM Downloads](https://img.shields.io/npm/dm/@hexagon/base64.svg)](https://www.npmjs.org/package/@hexagon/base64) [![jsdelivr](https://data.jsdelivr.com/v1/package/npm/@hexagon/base64/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@hexagon/base64) \n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Hexagon/base64/blob/master/LICENSE) \n\n*   Supports regular base64 and base64url\n*   Convert to/from string or arraybuffer\n*   Validate / identify base64 and base64url\n*   Works in Node.js \u003e=4.0 (both require and import).\n*   Works in Deno \u003e=1.16.\n*   Works in browsers as standalone, UMD or ES-module.\n*   Includes [TypeScript](https://www.typescriptlang.org/) typings.\n\n\n```javascript\n// Encode string as regular base64\nconst example1enc = base64.fromString(\"Hellö Wörld, how are you doing today?!\");\nconsole.log(example1enc);\n// \u003e SGVsbMO2IFfDtnJsZCwgaG93IGFyZSB5b3UgZG9pbmcgdG9kYXk/IQ==\n\n// Decode string as regular base64\nconst example1dec = base64.toString(\"SGVsbMO2IFfDtnJsZCwgaG93IGFyZSB5b3UgZG9pbmcgdG9kYXk/IQ==\");\nconsole.log(example1dec);\n// \u003e Hellö Wörld, how are you doing today?!\n```\n\nFull documentation available at [base64.56k.guru](https://base64.56k.guru)\n\n## Quick Installation\n\n**Node.js:**\n\n```bash\nnpm install @hexagon/base64 --save\n```\n\n**Deno (x):**\n```js\nimport { base64 } from \"https://deno.land/x/b64@2.0.4/src/base64.ts\";\n```\n\n**Deno (jsr.io):**\n```js\nimport { base64 } from \"jsr:@hexagon/base64\";\n```\n\nFor browser/cdn usage, refer to the documentation.\n\n### Quick API\n\n - __fromArrayBuffer(buffer, urlMode)__ - Encodes `ArrayBuffer` into base64 or base64url if urlMode(optional) is true\n - __toArrayBuffer(str, urlMode)__ - Decodes base64url string (or base64url string if urlMode is true) to `ArrayBuffer`\n\n - __fromString(str, urlMode)__ - Encodes `String` into base64 string(base64url string if urlMode is true)\n - __toString(str, urlMode)__ - Decodes base64 or base64url string to `String`\n\n- __validate(str, urlMode)__ - Returns true if `String` str is valid base64/base64 dependending on urlMode\n\n## Contributing\n\nSee [Contribution Guide](https://base64.56k.guru/contributing.html)\n\n## Donations\n\nIf you found this library helpful and wish to support its development, consider making a donation through [Hexagon's GitHub Sponsors page](https://github.com/sponsors/hexagon). Your generosity ensures the library's continued development and maintenance.\n\n### Contributors\n\nThe underlying code is loosely based on [github.com/niklasvh/base64-arraybuffer](https://github.com/niklasvh/base64-arraybuffer)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexagon%2Fbase64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexagon%2Fbase64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexagon%2Fbase64/lists"}