Skip to main content
URL.createObjectURL - node__url.d.ts - Node documentation
method URL.createObjectURL
Unstable

Usage in Deno

```typescript import { URL } from "node:node__url.d.ts"; ```
URL.createObjectURL(blob: NodeBlob): string
Creates a `'blob:nodedata:...'` URL string that represents the given `Blob` object and can be used to retrieve the `Blob` later. ```js import { Blob, resolveObjectURL, } from 'node:buffer'; const blob = new Blob(['hello']); const id = URL.createObjectURL(blob); // later... const otherBlob = resolveObjectURL(id); console.log(otherBlob.size); ``` The data stored by the registered `Blob` will be retained in memory until `URL.revokeObjectURL()` is called to remove it. `Blob` objects are registered within the current thread. If using Worker Threads, `Blob` objects registered within one Worker will not be available to other workers or the main thread.

Parameters

blob: NodeBlob

Return Type

string