---
title: TransformStream
summary: The TransformStream class as specified by WHATWG
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/interface.TransformStream/
---

**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#L1988

```javascript
interface TransformStream<I = any, O = any>
```

The TransformStream class as [specified by WHATWG](https://streams.spec.whatwg.org/#ts-class)

**See also**

- [TransformStream on MDN](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)

## Constructor

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

```javascript
new TransformStream(transformer?: Transformer<I, O>, writableStrategy?: QueuingStrategy<I>, readableStrategy?: QueuingStrategy<O>)
```

The TransformStream class as [specified by WHATWG](https://streams.spec.whatwg.org/#ts-class)

**See also**

- [TransformStream on MDN](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream)

**Parameters**

- `transformer`: `Transformer<I, O>` (optional)
- `writableStrategy`: `QueuingStrategy<I>` (optional)
- `readableStrategy`: `QueuingStrategy<O>` (optional)

## Properties

### readable

**Type:** `ReadableStream<O>`  
**Flags:** read-only  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1989

### writable

**Type:** `WritableStream<I>`  
**Flags:** read-only  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L1990
