Installing Base64
Node.js
npm install @hexagon/base64 --save
JavaScript:
// ESM Import
import { base64 } from "@hexagon/base64";
// ... or CommonJS Require
const { base64 } = require("@hexagon/base64");
TypeScript:
import { base64 } from "@hexagon/base64";
// ...
Deno
JavaScript:
// Deno.land/x
import { base64 } from "https://deno.land/x/b64@2.0.3/src/base64.ts";
// ... or jsr.io
import { base64 } from "jsr:@hexagon/base64@2.0.3";
TypeScript:
// Deno.land/x
import { base64 } from "https://deno.land/x/b64@2.0.3/src/base64.ts";
// ... or jsr.io
import { base64 } from "jsr:@hexagon/base64@2.0.3";
Browser
Manual
- Download the latest zipball.
- Unpack.
- Grab
base64.umd.js
(UMD and standalone) orbase64.js
(ES-module) from the dist/ folder.
CDN
For a UMD-module (standalone, RequireJS, etc.):
<script src="https://cdn.jsdelivr.net/npm/@hexagon/base64@2/dist/base64.umd.js"></script>
As an ES-module:
<script type="module">
import { base64 } from "https://cdn.jsdelivr.net/npm/@hexagon/base64@2/dist/base64.js";
// ... see 'Usage' section ...
</script>