Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/reader.js>readAsObjectURL

A JavaScript extension package for building strong and modern applications.
Latest
function readAsObjectURL
import { readAsObjectURL } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/reader.js";

Reads all data from the given source to an object URL.

Examples

Example 1

import { readAsObjectURL } from "@ayonli/jsext/reader";

const file = new File(["Hello, World!"], "hello.txt", { type: "text/plain" });
const objectURL = await readAsObjectURL(file, file.type);

console.log(objectURL); // e.g. blob:http://localhost:8080/7b8e7b7d-7b7d-7b7d-7b7d-7b7d7b7d7b7d

Parameters

source
type