# exportToStream (@salmonui/data-grid/engine/export-server)

> The exportToStream function of @salmonui/data-grid/engine/export-server: Streams an export to a Node Writable (for example an http.ServerResponse or fs.createWriteStream) or a Web WritableStream, honoring backpressure, and ends the target. Resolves to the file name, MIME type, and byte count, or null when onBeforeExport prevents the export (the target is then left untouched).

Canonical: https://salmonui.dev/docs/reference/data-grid/engine-export-server/exportToStream

```ts
import { exportToStream } from '@salmonui/data-grid/engine/export-server';
```

Entry index: https://salmonui.dev/docs/reference/data-grid/engine-export-server (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine-export-server.md).

## Reference

Kind: function

```ts
function exportToStream<Row>(source: ServerExportSource<Row>, target: NodeWritableLike | WebWritableStreamLike, options: ServerExportOptions<Row>, handlers?: ServerExportHandlers<Row>): Promise<ExportStreamResult | null>;
```

Streams an export to a Node `Writable` (for example an `http.ServerResponse`
or `fs.createWriteStream`) or a Web `WritableStream`, honoring
backpressure, and ends the target. Resolves to the file name, MIME type,
and byte count, or null when `onBeforeExport` prevents the export (the
target is then left untouched).
