# stream

```ts
function stream<T, R>(iterable: AsyncIterable<T, R>): Stream<T, R>
```

Convert any [`AsyncIterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols) into an Effection [Stream](https://frontside.com/effection/api/v3/Stream.md).

This allows you to consume any `AsyncIterable` as a [Stream](https://frontside.com/effection/api/v3/Stream.md).

### Type Parameters
T


R


### Parameters


**iterable**: AsyncIterable&lt;T, R&gt;


the async iterable to convert
### Return Type


[Stream](https://frontside.com/effection/api/v3/Stream.md)&lt;T, R&gt;


a stream that will produce each item of `iterable`

[View code](https://github.com/thefrontside/effection/tree/effection-v3.6.1/lib/async.ts#L27)
