---
title: ReadableStreamDefaultController
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/interface.ReadableStreamDefaultController/
---

**Kind:** Interface  
**Module:** [globals](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/)  
**Package:** @fastly/js-compute 4.0.1  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1883

```javascript
interface ReadableStreamDefaultController<R = any>
```

## Constructor

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1895

```javascript
new ReadableStreamDefaultController()
```

## Properties

### desiredSize

**Type:** `number | null`  
**Flags:** read-only  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1884

## Methods

### close

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1885

```javascript
close(): void
```

**Returns**

`void`

### enqueue

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1886

```javascript
enqueue(chunk: R): void
```

**Parameters**

- `chunk`: `R`

**Returns**

`void`

### error

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1887

```javascript
error(e?: any): void
```

**Parameters**

- `e`: `any` (optional)

**Returns**

`void`
