[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:236](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Object.ts#L236)

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);
console.log(objectUrl.url); // 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/.bun/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts:36

#### Inherited from

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

## Properties

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

### url

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

Defined in: [packages/common/src/Object.ts:238](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Object.ts#L238)

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