@wtasnorg/node-lib / decode
decode(
input,charset?):string
Defined in: src/base64.ts:119
Decode a Base64 string.
string
The Base64 encoded string.
"standard" | "urlsafe" | "imap" | "radix64"
The charset variant to use (default: “standard”).
string
The decoded string.
import { decode } from "./base64.js";
decode("SGVsbG8sIFdvcmxkIQ==");
// => "Hello, World!"
decode("SGVsbG8sIFdvcmxkIQ==", "standard");
// => "Hello, World!"
Error if the input contains invalid characters.