npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-pictureset

v0.0.14

Published

v0.0.3 Vue plugin to manage all pictures in your project. Handle all srcsets in a picture tag with a simple and lightweight plugin. You can specify sizes for every media query or select a ratio based on screen width. It will generate src file for the defi

Downloads

4

Readme

vue-pictureset

v0.0.3 Vue plugin to manage all pictures in your project. Handle all srcsets in a picture tag with a simple and lightweight plugin. You can specify sizes for every media query or select a ratio based on screen width. It will generate src file for the defined media queries and for 1x, 2x, 3x pixel ratio. It will also convert your image in webp format (wherever possible), using the input format as fallback. It works with Contentful and Storyblok images API. Custom resize will work soon.

Installation

npm i vue-pictureset

or

yarn add vue-pictureset

Then you can install your plugin globally with

...
import PictureSet from 'vue-pictureset'

Vue.use(PictureSet, {
  imagesApi: 'contentful'
})
...

At this moment only "contentful" is available as Image Api

Usage

You can use the plugin as a simple component in Vue.

<picture-set src="YOUR_IMAGE_URL" alt="YOUR_IMAGE_ALT" title="YOUR_IMAGE_TITLE" :size="0.75" />

Options

| Parameter | Required | Type | Default | Description | |--------------|----------|-----------------|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | src | true | String | | Source url of your image | | alt | | String | | Alternative description of your image | | title | | String | | Title of your image | | size | true | Array | Number | | If is a number it will use the value as ratio for the higher screen size in mediaQuery param. Ex: and mediaQueries is [1200, 1024, 768] it will return images with the following width: 12000.75, 10240.75, 768*0.75 It can also be an array of media queries with width and height defined. Ex: size = [ { 1200: { w: 1000, h: 500 } }, { 768: { w: 300, h: 150 } } ] If you're using the Contentful plugin you can also specify the fit property inside the object. Ex: size = [ { 1200: { w: 1000, h: 500, fit: 'fill' } }, { 768: { w: 300, h: 150, fit: 'fill' } } ] | | mediaQueries | | Array | [ 1980 , 1536 , 1280 , 1024 , 768 , 640 ] | Array of media queries | | Quality | | Object | { webp : 75 , default : 80 } | Define the quality to be use in webp format and input format. | | imgStyle | | Object | | Style object for the img tag. | | imgClass | | String | | Class of img tag | | loading | | String | lazy | Loading property of img tag. Accepted values are "auto", "lazy", "eager" |

Coming very very soon

Prismic and Storyblok support

Coming soon

Integrated resize tool for every image. Skeleton as placeholder for image loading. Support to various images api systems.