npm install webp-handler
- var webpHandler = require('webp-handler)
- var instance = new webpHandler({servers:['aaa.com','bbb.com','ccc.com']})
- var webpimgUrl = instance.img2webp(imgurl)
-
new webpHadler(options) => options is an object includes servers(required) and time servers are the domain that you store your static resource,time is the cookie expiretime(day)
-
img2webp(imgurl) => imgurl must be complete
- var webpHandler = require('webp-handler)
- var instance = new webpHandler({servers:['aaa.com','bbb.com','ccc.com'],cookie:yourcookie})
- var webpimgUrl = instance.img2webp(imgurl)
-
new webpHadler(options) => options is an object includes servers(required) and cookie(required) servers are the domain that you store your static resource
-
cookie's name is webp_support ,u need to get it first
-
img2webp(imgurl) => imgurl must be complete