https://github.com/doga/base64
A JavaScript library for converting to/from base64.
https://github.com/doga/base64
base64
Last synced: over 1 year ago
JSON representation
A JavaScript library for converting to/from base64.
- Host: GitHub
- URL: https://github.com/doga/base64
- Owner: doga
- License: apache-2.0
- Created: 2025-03-30T09:47:54.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-30T10:18:21.000Z (over 1 year ago)
- Last Synced: 2025-03-30T11:23:41.995Z (over 1 year ago)
- Topics: base64
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Base64 conversions
A JavaScript library for converting to/from [base64](https://developer.mozilla.org/en-US/docs/Glossary/Base64).
## Usage example
Convert string to/from base64:
description = '''
'''
```javascript
import {stringToBase64, base64ToString} from "https://esm.sh/gh/doga/base64@1.0.0/mod.mjs";
const
strIn = 'hello',
base64 = stringToBase64(strIn),
strOut = base64ToString(base64);
console.info(`strIn: "${strIn}", base64: "${base64}", strOut: "${strOut}"`);
```
Sample output for the code above:
```text
strIn: "hello", base64: "aGVsbG8=", strOut: "hello"
```
### Run the usage example
Run the example above by typing this in your terminal (requires [Deno](https://deno.com/) 2+):
```shell
deno run --allow-net --allow-run --allow-env --allow-read jsr:@andrewbrey/mdrb@3.0.4 --dax=false --mode=isolated https://raw.githubusercontent.com/doga/base64/refs/heads/main/README.md
```
∎