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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gulp-rev-happy

v1.0.4

Published

improve gulp-rev2

Readme

gulp-rev-happy

给资源文件添加文件指纹,改进自 gulp-rev2

a.pnga-f7ee61d96b.png(文件名方式)

a.pnga.png?_v_=f7ee61d96b(url参数方式)

处理了rev2的一些问题:

1、不能为html和js文件添加指纹
2、多次调用update,导致的指纹累积 ?v=560396f564?v=560396f564
3、如果原本的链接带了url参数,导致出现两个问号 ?v=560396f564?aaa=bbb
4、同一个gulp的task中,生成manifest后马上调用update,因为require缓存不能读取刚生成的manifest

Install

$ npm install --save-dev gulp-rev-happy  

Usage1 使用url参数方式构建文件指纹

demo1

Usage2 使用文件改名方式构建文件指纹

demo2

设计思路

修改自 gulp-rev , gulp-rev-collectorgulp-rev2 ,主要实现如下:

  1. 根据文件的内容 file.contents 生成文件指纹(hash值);

  2. 根据前面生成的文件指纹集合成一张(源文件,构建文件)映射对照表(并保存在清单文件 rev-manifest.json 中);

  3. 根据前面生成的映射对照表级联更新存在引用的父文件;

配置项

rev([opts])

query

Type: boolean
Default: false

设置文件指纹的关联方式,true 通过url参数关联 a.pnga.png?_v_=f7ee61d96bfalse 通过文件名关联 a.pnga-f7ee61d96b.png

其他配置项同 gulp-rev-collector

collectedManifest 指定需要合并的manifest文件

replaceReved 允许替换已经替换过的文件

dirReplacements 目录替换

revSuffix 文件指纹生成方式

extMap 扩展名替换