Encode. Decode. Simplified.
@dephub/base64 — a utility for encoding UTF-8 strings to Base64 and decoding Base64 back to UTF-8.
- 🔹 Simple API:
encode()anddecode()functions - 🚀 CLI support: encode/decode directly from the terminal
- 🔄 Reliable Base64 encoding/decoding — handles all UTF-8 characters correctly
- 🌐 Cross-environment — works in Node.js and modern browsers
- ⚡ Fast performance — minimal and efficient Base64 operations
- npm:
npm install @dephub/base64 - pnpm:
pnpm add @dephub/base64 - yarn:
yarn add @dephub/base64 - bun:
bun add @dephub/base64
import { encode, decode } from '@dephub/base64';
const encoded = encode('hello');
console.log(encoded); // "aGVsbG8="
const decoded = decode(encoded);
console.log(decoded); // "hello"# Encode string
base64 encode "hello"
# Output: aGVsbG8=
# Decode string
base64 decode "aGVsbG8="
# Output: hello
# Show help
base64 --helpCommands:
encode <string> : Encode string to Base64
decode <base64> : Decode Base64 to string
--help : Show help message
--version : Show version
MIT License – see LICENSE for details.
Author: Estarlin R (estarlincito.com)