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

cn-patent-ipc

v0.1.3

Published

Chinese-edition IPC patent classification — 79,978 entries (section/class/subclass/group) with titles and effective editions, plus the CNIPA strategic-emerging-industry (SEI) mapping. Zero runtime dependencies. 中文版专利国际专利分类(IPC)数据:约 8 万条分类号(含名称与生效版次),附战略性新

Readme

cn-patent-ipc

npm node dependencies module types license

中文版国际专利分类(IPC)数据包:含中文标题与生效版次(1985.01 → 2026.01),附 国家知识产权局战略性新兴产业(SEI)参照映射,提供 TypeScript 查询 API 与 PostgreSQL 种子 SQL。English

  • IPC:79,978 条,即 8 部 · 132 大类 · 655 小类 · 7,668 主组 · 71,515 分组
  • SEI:40 个产业代码、321 条规则、34,598 条 IPC↔SEI 映射
  • 姊妹包:cn-divisions,中国 行政区划数据(含拼音)

安装

npm install cn-patent-ipc

版本变更与升级步骤见 CHANGELOG.md(英文)。

IPC API

import {
  allIpc,
  lookup,
  ancestors,
  searchByName,
  byVersion,
  countByType,
} from "cn-patent-ipc";

lookup("A01B1/24");
// { code: "A01B1/24", type: "分组", level: 1, name: "处理草地或草坪用的犁", version: "2006.01" }

ancestors("A01B1/24").map((e) => e.code); // ["A", "A01", "A01B", "A01B1/00"]
searchByName("半导体", { type: "小类" }); // 按标题子串搜索,结果含 H10D
byVersion("2026.01"); // 2026.01 版生效的条目
countByType(); // 各层级条目数
  • ancestors 按结构推导到主组为止,分组之间的嵌套在数据中没有记录;代码不存在 时返回空数组。
  • searchByName 的搜索词为空或纯空白时抛出 TypeError。
  • 条目是冻结对象,类型为 readonly。allIpc() 返回全量共享数组,其余函数返回 新数组。

SEI API

import { seiOfIpc, ipcOfSei, seiRulesByCode } from "cn-patent-ipc/sei";

seiOfIpc("A01B"); // 命中该 IPC 号的 SEI 规则
ipcOfSei("2.1"); // 映射到产业代码 2.1 的 IPC 条目
seiRulesByCode("1.1"); // 该产业代码的全部关键词规则

映射只做精确匹配。需要按小类覆盖时,自行用 ancestors 或 allIpc 展开。

原始数据与 SQL 种子

  • cn-patent-ipc/data/{ipc,sei,ipc-sei}.jsonl:规范数据,每行一个 JSON 对象, 已排序。
  • cn-patent-ipc/sql/postgresql/{patent_ipc,patent_sei,patent_ipc_sei}.sql: PostgreSQL 种子,自带建表语句与索引。先导入 patent_ipc 和 patent_sei,再 导入 patent_ipc_sei。

种子可重复导入:按主键 upsert,新版会更新有变化的行,但不会删除旧行。自行建表 时,code 和 id 须有主键或唯一约束。文件路径可用 require.resolve("cn-patent-ipc/sql/postgresql/patent_ipc.sql") 取得,ESM 中 先用 createRequire 创建 require。

许可

MIT。数据来源、已知瑕疵与未收录内容见 NOTICE.md。