# Streaming & Large Responses — NestJS: Building Scalable Node.js APIs

Source: https://www.skillbyai.com/en/nestjs/nestjs-streaming

> Stream large files and responses with StreamableFile instead of loading them into memory.

## Stream a file

Use `StreamableFile` or Express' response object to stream large files without loading into memory.

```typescript
import { StreamableFile } from '@nestjs/common';
import { createReadStream } from 'fs';

@Get('download')
downloadFile(): StreamableFile {
  const file = createReadStream('large-file.zip');
  return new StreamableFile(file);
}
```
