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 🙏

© 2025 – Pkg Stats / Ryan Hefner

yp

v2.0.3

Published

publish static resources

Downloads

86

Readme

支持增量构建的前端静态资源处理工具

Build Status Coverage Status Build status

Code Climate

English version

需要nodejs 4.2以上版本。因为使用了一些v8实现中实验性的es6特性: Proxy等, 在运行时使得node的命令行参数带有**--harmony-proxies**

在windows下暂时输出的map.json文件里面资源名是 \


性能

非增量式:

在一个 Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz (6 core)机器上,构建一个含有10k+文件的项目,其中包含5k+个需要构建的文件, 初始化构建花费时间平均10.5s,最好9s,最差13s

增量式:

一般耗时秒级

使用说明

1.安装nodejs

需要4.2以上版本

2.安装 pss

npm install -g yp

3.对每个project设置pss.json, 也就是构建的配置文件

{
  "rootPath":"sampleProject",
  "uriConfig": {
    "baseUri":"",
    "protocol":"http://",
    "suffix":"?v=1"
  },
  "ignore":[["^image/fis/article/","/.[^.]+$","^.[^.]+$"],["\\.html$","\\.htm$"]],
  "dir":["image","themes"],
  "mapJsonPath":"demoout/map.json",
  "outdir":"demoout",
  "logdir":"/var/log/pss",
  "logLevel": 0
}

其中各字段: rootPath :项目的根路径,相对于执行pss时的目录, 默认是执行命令时的目录

uriConfig: 生成的json中将包含,为生成url所需的各项配置

ignore:构建中忽略的目录,注意要是正则字符串

dir:需要构建的目录,值得注意的是,不参与构建的将会被原样输出(复制)到outdir

mapJsonPath:存放map.json的路径,如果是绝对路径,则原样输出,如果是相对路径,则是转化为 $rootpath/../$mapJsonPath

outdir:输出目录,将被转化为 $rootPath/../$outdir

logLevel:日志输出级别, 0:info, 1:warning, 2:error ; 默认是0

4.初次构建(从给定的map.json路径读不到文件或者出错时,自动执行)

cd 到指定目录下,执行pss即可

5.增量构建

以管道方式传入需要构建的文件列表即可 例如 svn log | pss

6.构建的输出

将会把新增的文件(image和themes目录)输出到标准输出

示例

dist/image/ar/article/461/banner1.jpg
dist/image/www/1_vbaf8c63.jpg
dist/image/www/tab_language_v8a0bb55.jpg
dist/image/www/css/stylesheet_up_vea48724.css
dist/image/www/css/stylesheet_zong_v0960048.css
dist/map.json

7.注意事项

ulimit -n 需要改大一些,可以是65535

默认的日志路径是 /var/log/pss

示例工程
git clone https://github.com/renaesop/pss.git
cd pss/sample
pss