Closed XhmikosR closed 3 years ago
If useful to anyone, a simple file download can be replaced with this
import * as fetch from 'node-fetch';
import * as util from 'util';
import { pipeline } from 'stream';
...
const streamPipeline = util.promisify(pipeline);
const response = await fetch(url, options);
await streamPipeline(response.body, fs.createWriteStream(job.filepath));
Hmm, it doesn't seem to be flagged anymore for some reason.
@sindresorhus Haven't looked into the details of this package, but I take it that updating got alone would need a major version bump?