base64-js

base64-js does basic base64 encoding/decoding in pure JS.

build status

Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.

Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.

install

With npm do:

npm install base64-js and var base64js = require('base64-js')

For use in web browsers do:

<script src="base64js.min.js"></script>

Get supported base64-js with the Tidelift Subscription

methods

base64js has three exposed functions, byteLength, toByteArray and fromByteArray, which both take a single argument.

license

MIT

base64-js - Installation

To install base64-js via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install base64-js --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install base64-js

Learn more about the config option.

PNPM

pnpm install base64-js --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install base64-js --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

base64-js - Download

Download Tarball (v1.5.1)

Integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
SHASUM 1b1b440160a5bf7ad40b650f095963481903930a
Tarball https://js.registry.sudovanilla.org/base64-js/-/base64-js-1.5.1.tgz