Skip to content

dephub-js/base64

Repository files navigation

@dephub/base64

Encode. Decode. Simplified.

@dephub/base64 — a utility for encoding UTF-8 strings to Base64 and decoding Base64 back to UTF-8.

NPM version ESM-only


Features ✨

  • 🔹 Simple API: encode() and decode() 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

Installation 💿

  • npm: npm install @dephub/base64
  • pnpm: pnpm add @dephub/base64
  • yarn: yarn add @dephub/base64
  • bun: bun add @dephub/base64

Usage 📦

API </>

import { encode, decode } from '@dephub/base64';

const encoded = encode('hello');
console.log(encoded); // "aGVsbG8="

const decoded = decode(encoded);
console.log(decoded); // "hello"

CLI 🖥️

# Encode string
base64 encode "hello"
# Output: aGVsbG8=

# Decode string
base64 decode "aGVsbG8="
# Output: hello

# Show help
base64 --help

Commands:

encode <string>  : Encode string to Base64
decode <base64>  : Decode Base64 to string
--help           : Show help message
--version        : Show version

License 📄

MIT License – see LICENSE for details.

Author: Estarlin R (estarlincito.com)

About

Simple Base64 encoding and decoding utilities for Node.js and browsers

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors