[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Object](https://evolu.dev/docs/api-reference/common/Object) › ObjectURL

Defined in: [packages/common/src/Object.ts:428](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Object.ts#L428)

A disposable wrapper around `URL.createObjectURL` that automatically revokes
the URL when disposed. Use with the `using` declaration for automatic
cleanup.

### Example

```ts

const blob = new Blob(["hello"], { type: "text/plain" });
using objectUrl = createObjectURL(blob);

assertTrue(objectUrl.url.startsWith("blob:"));
// URL.revokeObjectURL is automatically called when the scope ends.
```

This ensures the URL is always revoked when the scope ends, even if an error
occurs, preventing memory leaks from unreleased blob URLs.

## Extends

- [`Disposable`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management)

## Methods

<a id="dispose"></a>

### \[dispose\]()

```ts
dispose: void;
```

Defined in: node\_modules/@typescript/old/lib/lib.esnext.disposable.d.ts:34

#### Inherited from

```ts
Disposable.[dispose]
```

## Properties

<a id="url"></a>

### url

```ts
readonly url: string;
```

Defined in: [packages/common/src/Object.ts:430](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Object.ts#L430)

The object URL string created by `URL.createObjectURL`.