You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to get file extension and mime type I'm getting the error TypeError: stream.getReader is not a function.
My code:
returnresponses.map((r)=>r.data).filter(async(image)=>{constfetchedURL=got.stream(image.url)asany;constfileInfo=awaitFileExt.fromStream(fetchedURL);fileTypes.includes(fileInfo.ext);console.log(fileInfo.ext);// stream.getReader is not a function});
The text was updated successfully, but these errors were encountered:
It is a bit guess work to get your example running, this was my interpetation:
constgot=require('got').default;constFileExt=require('file-type');functiongetResponeses(r){r.map((r)=>r.data).filter(async(image)=>{constfetchedURL=got.stream(image.url);constfileInfo=awaitFileExt.fromStream(fetchedURL);console.log(fileInfo.ext);// stream.getReader is not a function});}getResponeses([{data: {url: 'https://github.com/sindresorhus/file-type/raw/main/fixture/fixture.jpg'}},{data: {url: 'https://github.com/sindresorhus/file-type/raw/main/fixture/fixture.png'}},{data: {url: 'https://github.com/sindresorhus/file-type/raw/main/fixture/fixture.gif'}}]);
When I try to get file extension and mime type I'm getting the error
TypeError: stream.getReader is not a function
.My code:
The text was updated successfully, but these errors were encountered: