import { Base64 } from "https://deno.land/x/bb64@1.1.0/mod.ts";
This class provides an easy interface to perform base64 encoding on strings and files.
Methods
toFileWithMime(filePath: string): void
Writes the base64 string from the Base64 object to a file, including the MIME type when writing to the file.
toStringWithMime(): string
Returns the base64 encoded string from the Base64 object, with the inclusion of the MIME type if the Base64 object was created from a file (and if not created from a file, works the same as the .toString() method)
Static Methods
fromBase64File(filePath: string): Base64
Creates a Base64 object from the contents of an already base64 encoded file
fromBase64String(encodedString: string): Base64
Creates a Base64 object from an already base64 encoded string
fromBase64Uint8Array(uint8arr: Uint8Array): Base64
Creates a Base64 object from a base64 encoded Uint8Array