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
Vingle - Vingle, Very Community. Love the things that you love. - We're hiring!
Install
$ npm install webpinfo
Supported WebP Formats
Simple File Format (Lossy)
Simple File Format (Lossless)
Extended File Format (e.g. Animated WebP)
Supported WebP Chunks
VP8
VP8L
VP8X
ANIM
ANMF
ALPH
ICCP
EXIF
XMP
Usage
Promise interface
import{WebPInfo}from"webpinfo";// local file pathconstinfo=awaitWebPInfo.from("/some/local/file/path.webp");// urlconstinfo=awaitWebPInfo.from("https://example.com/some/file/path.webp");// bufferconstinfo=awaitWebPInfo.from(buf);// readable streamconstinfo=awaitWebPInfo.from(fs.createReadStream(path));console.log("INFO: ",info);
Stream interface
import*ashttpfrom"http";import{WebPInfo}from"webpinfo";http.get("https://www.gstatic.com/webp/gallery/1.webp",(res)=>{if(res.statusCode!==200){console.log("unexpected status code: ",res.statusCode);return;}res.pipe(newWebPInfo()).on("error",(e)=>console.log("error",e)).on("riff",(riff)=>console.log("riff",riff)).on("chunk",(chunk)=>console.log("chunk",chunk)).on("format",(format)=>console.log("format",format));});
mooyoul/is-webp-extended - Extended version of is-webp package which supports Animated WebP. Compatible with Browser environment (e.g. File, ArrayBuffer)