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

@kookapp/compatibility

v0.0.15

Published

Compatibility package

Readme

Changelog

0.0.1

初始版本,新增 ItemStore 兼容层。


Compatibility

当本体引入破坏性改变时,如删除了某个导出函数,则所有热更包都总需要考虑 2 种情况:

  • 旧本体,只有旧实现,没有新实现;
  • 新本体,只有新实现,没有旧实现;

此外:

  • 本体与热更的放量不同步,谁先上或者谁后上都不行。

因此为了兼容,通常在热更代码中,会包含对新旧实现的抽象,从而避免代码太难看、总要处处照顾不同情况。

考虑到不同的热更项目代码不互通,为了统一抽象,建立了此 compatibility 包,专用于存放兼容用的抽象层。

适用范围

当以下条件满足,则应该考虑使用此包:

  • 本体放量到一半
  • 本体有破坏性改变,导致热更的放量必须至少覆盖新本体

不过,热更项目不应该一直依赖此包。等到对应本体全量后,就应该考虑去除对 compatibility 包的依赖了。

项目依赖

  • radash

由于此包的特殊性,最好不要包含和本体相关的依赖,尤其不要反过来依赖本体。

项目迭代

兼容层在迭代的时候最好总是保持后向兼容,只做加法。