I am trying to download data into JSON file from URL in nestjs but I cannot figure out how to do it.

Below is my controller function with reference to this [answer](https://stackoverflow.com/a/56288163/3022326).

```
export class DataController {
constructor(private readonly httpService: HttpService) { }

@Get()
async download(@Res() res) {
    const writer = createWriteStream('user.json');

    const response = await this.httpService.axiosRef({
        url: 'https://api.github.com/users/prasadg',
        method: 'GET',
        responseType: 'stream',
        headers: {
            'Content-Type': 'application/json',
        }
    });

    response.data.pipe(writer); <--- Error here:  Property 'pipe' does not exist on type 'unknown'.

    return new Promise((resolve, reject) => {
        writer.on('finish', resolve);
        writer.on('error', reject);
    });
}

```

As I mentioned above it is showing error

> 
> error TS2339: Property 'pipe' does not exist on type 'unknown'
> 
> 
> 

**Expected result** : I want to write json data into file (user.json) in my folder on server.

How do I solve this problem?