npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

base64plus

v1.2.0

Published

A modern, Unicode-safe Base64 encoding and decoding library for JavaScript.

Downloads

34

Readme

Base64Plus

Build Status npm version Total Downloads Latest Release License

Base64Plus is a modern, Unicode-safe Base64 encoding and decoding library. It supports Node.js, ES Modules, Browsers, and TypeScript with a built-in polyfill for Node.js environments.

  • Handles Unicode strings properly: Native atob/btoa fail with multi-byte characters like emojis or non-Latin scripts.
  • Works in both Node.js & Browsers: Node.js lacks atob/btoa, but Base64Plus provides a seamless polyfill.
  • Supports ES Modules & TypeScript: Fully typed for modern JavaScript projects.
  • Encodes and decodes Buffers: Unlike atob, which only works with plain strings.
  • No dependencies & lightweight: Small package size with no external dependencies.

Table Of Contents

  1. Installation
  2. Usage
  3. API Reference
  4. Development & Contribution
  5. Changelog
  6. License

1. Installation

  • Option 1: Install via NPM

    npm install base64plus
  • Option 2: Use via CDN

Include the UMD version directly in your HTML file:

<script src="https://github.com/nassiry/base64plus/releases/latest/download/base64Plus.umd.js"></script>
<script>
  console.log(Base64Plus.encode("Hello, World!"));
</script>
  • Option 3: Download Manually

Get the latest release from GitHub Releases.

2. Usage

  • Node.js (CommonJS)

    const Base64Plus = require("base64plus");
      
    const encoded = Base64Plus.encode("Hello, World!");
    console.log(encoded); // Base64 string
      
    const decoded = Base64Plus.decode(encoded);
    console.log(decoded); // Hello, World!
    
    const encodedUrl = Base64Plus.encodeUrl("Hello, World!");
    console.log(encodedUrl); // Base64 string  
      
    const decodedUrl = Base64Plus.decodeUrl(encodedUrl);
    console.log(decodedUrl); // Hello, World!
  • ES Modules / TypeScript

    import Base64Plus from "base64plus";
      
    const encoded = Base64Plus.encode("Base64 Encoding");
    console.log(encoded); // Base64 string
      
    const decoded = Base64Plus.decode(encoded);
    console.log(decoded); // Base64 Encoding

3. API Reference

Encoding and Decoding

  • Base64Plus.encode(input: string): string
    • Encodes a string to Base64 while supporting full Unicode characters.
  • Base64Plus.decode(base64String: string): string
    • Decodes a Base64 string back to a Unicode string.
  • Base64Plus.encodeUrl(input: string): string
    • Encodes a string to URL-safe Base64.
  • Base64Plus.decodeUrl(Base64String: string): string
    • Decodes a URL-safe Base64 string back to a Unicode string.

Validation

  • Base64Plus.isValid(base64String: string): boolean
    • Checks if a string is a valid Base64 string.

Deprecated: Base64Plus.isValidBase64(base64String: string): boolean Use Base64Plus.isValid instead.

4. Development & Contribution

Clone the Repository & install the dependencies.

git clone https://github.com/nassiry/base64plus.git
cd base64plus
npm install
  • Build the Project

    npm run build
  • Run Tests

    npm test

For more details on contributing, see CONTRIBUTING.

Changelog

See CHANGELOG for release details.

License

This package is open-source software licensed under the MIT license.