Skip to content
This repository was archived by the owner on Jan 3, 2026. It is now read-only.

Streams

Hyro edited this page Dec 10, 2021 · 3 revisions

Download Stream

const hyttpo = require('hyttpo').default;
const fs = require('fs');

(async() =>{
    const req = await hyttpo.request({
        method: 'GET',
        responseType: 'stream',
        url: 'stream url'
    })

    const file = fs.createWriteStream('./video.mp3');
    console.log(req.data.pipe(file))
})();
import hyttpo from 'hyttpo';
import * as fs from 'fs';

(async() =>{
    const req = await hyttpo.request({
        method: 'GET',
        responseType: 'stream',
        url: 'stream url'
    })

    const file = fs.createWriteStream('./video.mp3');
    console.log(req.data.pipe(file))
})();

Clone this wiki locally