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

ssnpmproxy

v1.0.2

Published

NPM供应链攻击可以成功实施的原因是:

Readme

ssnpmproxy

应用场景

NPM供应链攻击可以成功实施的原因是:

包管理工具在更新NPM包时,总是会选用满足依赖约束条件的最新版NPM包,并且该行为还不支持更改

只要不使用最新版NPM包,就能避开大多数供应链攻击,因为安全社区也会监测NPM仓库内的恶意NPM包,并上报给NPM仓库删除,恶意NPM包的存活时间是短的

该命令可以强制 npm, yarn, pnpm 等包管理器使用次新版NPM包

工作流程

  1. 获取该包的最新版发布天数,若发布天数大于15天(可配置),则信任它
  2. 若小于15天,则降级最新版包到已发布15天以上的次新版包

使用教程

初始化

在NodeJS项目的根目录下执行如下命令,而后会在根目录生成 npmproxy.json 配置文件

npx ssnpmproxy init

配置文件中,需要注意的只有 daysThreshold 字段,它表达信任发布多少天以上的NPM包

{
    "port": 40798,
    "sslPath": "/var/folders/rs/w_d4vmzd1j30zdr_tyxjsvqw0000gn/T/npmproxy-c0f16174b4fe05c3",
    "daysThreshold": 15
}

安装 / 更新包

使用 npm, yarn, pnpm 安装 / 更新NPM包时,在前面添加 npx ssnpmproxy 前缀,如下示例

npx ssnpmproxy yarn add ...
npx ssnpmproxy npm add ...
npx ssnpmproxy yarn upgrade

如下是一个使用示例,在启用npmproxy安装zustand时,它对发布在15天内的包进行了降级,例如将zustand降级到5.0.8

npx ssnpmproxy npm i zustand
starting server for registry.npmjs.org
https server started for registry.npmjs.org on 64057
⠇Downgrading zustand from 5.0.9 to 5.0.8
⠋Downgrading @types/react from 19.2.7 to 19.2.6
⠋Downgrading immer from 11.0.1 to 10.2.0

added 1 package, and audited 33 packages in 10s