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

fis3-parser-webp

v1.0.1

Published

"fis3处理html/scss图片webp化插件"

Downloads

3

Readme

fis3-postprocessor-webp

标准化后处fis3理插件(postprocessor阶段),可以针对html和scss文件中带*?__webp*后缀的图片webp化.

该插件完成的工作主要有两点:

  • 识别出文件中带?__webp后缀的图片链接并将其转化成webp格式图片

  • 兼容代码的处理:

    1.在html中:一是在head标签内插入webp的script兼容检测脚本,二是替换img为picture标签

    2.在scss中(实际是在css中):复写webp图片的引用类,使得样式表中优先加载webp格式图片

该插件目前仅支持png和jpg格式图片的webp化

Install

$ npm install fis3-postprocessor-webp -g --save-dev

Usage

// fis-conf.js 配置表
postprocessor: [
  fis.plugin('webp',{
  quality: 50
  })
]

// html中使用
<img src="/static/img/yhjy/btn-sign.png?__webp" alt="">

// scss中使用
background: url($imgURL + "btn-sign.png?__webp") no-repeat top center;

API

fis.plugin('webp',[options])

Options

  • quality
  • preset
  • alphaQuality
  • method
  • size
  • sns
  • filter
  • autoFilter
  • sharpness

含义参考 google cwebp api