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
npm install @squoosh/lib
# or
yarn add @squoosh/lib
// Save To FileexportconstsaveToFile=(path: string,content: string|NodeJS.ArrayBufferView): void=>{try{if(fs.existsSync(path)){fs.unlinkSync(path)}fs.writeFileSync(path,content)}catch(err){console.error(err)}}constisDS_Store=(fileName: string)=>{returnfileName!=='.DS_Store'}// Get all filesexportconstgetAllFiles=(path: string): string[]=>{try{constdata=fs.readdirSync(path).filter(isDS_Store)// console.log(data, data.length)returndata}catch(err){console.error(err)return[]}}
Squoosh
用 nodejs + squoosh 批量压缩处理图片
npm install @squoosh/lib # or yarn add @squoosh/lib
The text was updated successfully, but these errors were encountered: