{"id":21102156,"url":"https://github.com/juanelas/base64","last_synced_at":"2025-07-14T15:08:59.369Z","repository":{"id":57123204,"uuid":"417527992","full_name":"juanelas/base64","owner":"juanelas","description":"Base64 for both node.js and browser JavaScript. It supports URL-safe encoding and enabling/disabling padding. Buffers can be implemented using ArrayBuffer, any TypedArray or Buffer","archived":false,"fork":false,"pushed_at":"2023-11-10T11:08:41.000Z","size":912,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T03:42:06.317Z","etag":null,"topics":["arraybuffer","bas64url","base64","buffer","typedarray","uint8array"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/juanelas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-10-15T14:24:44.000Z","updated_at":"2024-08-18T11:26:58.000Z","dependencies_parsed_at":"2023-11-10T12:35:41.069Z","dependency_job_id":"5709a769-ebe1-4df5-8dfd-c82778e4bdda","html_url":"https://github.com/juanelas/base64","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/juanelas/base64","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanelas%2Fbase64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanelas%2Fbase64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanelas%2Fbase64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanelas%2Fbase64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juanelas","download_url":"https://codeload.github.com/juanelas/base64/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanelas%2Fbase64/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261124102,"owners_count":23113064,"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","bas64url","base64","buffer","typedarray","uint8array"],"created_at":"2024-11-19T23:54:14.268Z","updated_at":"2025-06-21T12:34:46.405Z","avatar_url":"https://github.com/juanelas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Node.js CI](https://github.com/juanelas/base64/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/juanelas/base64/actions/workflows/build-and-test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/juanelas/base64/badge.svg?branch=main)](https://coveralls.io/github/juanelas/base64?branch=main)\n\n# @juanelas/base64\n\nBase64 for both node.js and browser javascript. It supports URL-safe encoding and enabling/disabling padding. Buffers can be implementedd using ArrayBuffer, any TypedArray, or Buffer.\n\n## Usage\n\n`@juanelas/base64` can be imported to your project with `npm`:\n\n```console\nnpm install @juanelas/base64\n```\n\nThen either require (Node.js CJS):\n\n```javascript\nconst base64 = require('@juanelas/base64')\n```\n\nor import (JavaScript ES module):\n\n```javascript\nimport * as base64 from '@juanelas/base64'\n```\n\nThe appropriate version for browser or node is automatically exported. Types for TypeScript users are also provided.\n\nYou can also download the [IIFE bundle](https://raw.githubusercontent.com/juanelas/base64/main/dist/bundle.iife.js), the [ESM bundle](https://raw.githubusercontent.com/juanelas/base64/main/dist/esm/bundle.min.js) or the [UMD bundle](https://raw.githubusercontent.com/juanelas/base64/main/dist/bundle.umd.js) and manually add it to your project, or, if you have already installed `@juanelas/base64` in your project, just get the bundles from `node_modules/@juanelas/base64/dist/bundles/`.\n\nAn example of usage could be:\n\n```typescript\nimport * as base64 from '@juanelas/base64'\n\nconst buf = new Uint8Array([254, 1, 128, 255])\nconst base64str = base64.encode(buf, true, false) // URL-safe base64 with no padding\n\nconsole.log(base64str) // Outputs: '_gGA_w'\n\nconst buf2 = base64.decode(base64str) // URL-safe encoding and padding are automatically detected\n\nconsole.log(buf2.toString()) // Outputs: '254,1,128,255'\n\nconst text = 'fooba'\nconst base64str2 = base64.encode(text) // Standard base64 with padding\n\nconsole.log(base64str2) // Outputs: 'Zm9vYmE='\n\nconst text2 = base64.decode(base64str2, true) // Output to unicode string instead of Uint8Array\n\nconsole.log(text2) // Outputs: 'fooba'\n\n```\n\n## API reference documentation\n\n[Check the API](./docs/API.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanelas%2Fbase64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuanelas%2Fbase64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanelas%2Fbase64/lists"}