Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@upsidelab/vue-cdn-picture
Advanced tools
Vue component for serving optimized images from CDN services
For a full documentation visit: https://docs.upsidelab.io/vue-cdn-picture/
Modern CDNs and CMS systems provide ability to transform images that are to be served to the user. This makes it easier to optimize bandwidth usage, serve images in next-gen formats and provide multiple versions for HiDPI displays.
When it comes to the HTML markup, it gets a bit tricky. You still need to provide fallback for browsers that don't support .webp
or picture
HTML tag.
Vue CDN Picture is a simple library that makes it as simple as using the regular img
tag.
It's designed to work with CDNs and request images in optimal form, to optimize network usage.
yarn add @upsidelab/vue-cdn-picture
<GraphCmsCdnPicture
image-handle="AmYDOhxYRoWKk2y8twQW"
:width="800"
:height="600"
/>
will result in the following HTML markup:
<picture>
<source type="image/webp" srcset="https://media.graphcms.com/resize=w:800,h:600,fit:clip/output=format:webp/compress/AmYDOhxYRoWKk2y8twQW 1x,https://media.graphcms.com/resize=w:1600,h:1200,fit:clip/output=format:webp/compress/AmYDOhxYRoWKk2y8twQW 2x">
<source type="image/jpeg" srcset="https://media.graphcms.com/resize=w:800,h:600,fit:clip/output=format:jpeg/compress/AmYDOhxYRoWKk2y8twQW 1x,https://media.graphcms.com/resize=w:1600,h:1200,fit:clip/output=format:jpeg/compress/AmYDOhxYRoWKk2y8twQW 2x">
<img src="https://media.graphcms.com/resize=w:800,h:600,fit:clip/output=format:jpeg/compress/AmYDOhxYRoWKk2y8twQW" height="600" width="800">
</picture>
FAQs
Vue component for serving optimized images from CDN services
The npm package @upsidelab/vue-cdn-picture receives a total of 1 weekly downloads. As such, @upsidelab/vue-cdn-picture popularity was classified as not popular.
We found that @upsidelab/vue-cdn-picture 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.