universal-base64url
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Universal Base64 URL

NPM version NPM downloads Build status Test coverage Bundle size

Small universal base64url functions for node.js and browsers.

This is a small wrapper around universal-base64 to support URL-safe base64 in node.js and browsers.

Installation

npm install universal-base64url --save

Usage

import { decode, encode } from "universal-base64url";
 
encode("test"); //=> "dGVzdA"
decode("dGVzdA"); //=> "test"

TypeScript

This module uses TypeScript and contains type definitions on NPM.

Related

As of October 2018, https://github.com/brianloveswords/base64url exists but is using the node.js Buffer API, instead of falling back on atob/btoa in browsers. It also has some issues with TypeScript definitions (includes node.js types in browser) and old browser compatibility. This libraries API is smaller and simpler by avoiding these issues.

License

Apache 2.0

Package Sidebar

Install

npm i universal-base64url

Weekly Downloads

24,906

Version

1.1.0

License

Apache-2.0

Unpacked Size

7.14 kB

Total Files

9

Last publish

Collaborators

  • blakeembrey