Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
payload-webp
Advanced tools
payloadcms/payload plugin for automatic image conversion to webp format.
npm i payload-webp
OR yarn add payload-webp
payload.config.ts
:import webp from "payload-webp";
export default buildConfig({
serverURL: "http://localhost:3000",
...
plugins: [
webp(webpPluginOptions)
]
)};
query {
allMedia {
docs {
url # url of original file [jpeg/png/webp]
filesize # filesize of original file
webp {
url # url of webp processed file [webp]
filesize # filesize of webp processed file
sizes {
thumbnail {
width
height
url
}
}
}
}
}
}
By default webp images are being processed to reduce their filesize as well.
Optionally you can pass JSON with following plugin options to tweak compression or limit conversion to particular mimeTypes or specific upload-enabled collections.
interface WebpPluginOptions {
/**
* Which mime types convert to webp.
* Defaults to: ```["image/jpeg", "image/png", "image/webp"]```
*
* ***image/webp** is compressed*
*/
mimeTypes?: string[];
/**
* sharp webp options
* defaults to:
* ```
* {
* nearLossless: true,
* quality: 50,
* force: true,
* }```
*/
sharpWebpOptions?: sharp.WebpOptions;
/**
* Array of collection slugs that should have images converted to webp.
* By default all collections with upload property will convert images to webp.
*/
collections?: CollectionConfig["slug"][];
}
FAQs
payloadcms/payload plugin for automatic image conversion to webp format
The npm package payload-webp receives a total of 26 weekly downloads. As such, payload-webp popularity was classified as not popular.
We found that payload-webp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.