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

@aitianyu.cn/common-base

v0.0.4

Published

Common defines for all APIs in Node.JS only

Readme

@aitianyu.cn/common-base

Node.js only · CommonJS · TypeScript · v0.0.3


English Overview

@aitianyu.cn/common-base is the foundational common library for the AITianyu Node.js ecosystem. It provides reusable type definitions, interfaces, and utility helpers shared across all backend CSP (Cloud Service Platform) services.

Difference from @aitianyu.cn/types: @aitianyu.cn/types targets both Browser and Node.js environments with basic utilities. @aitianyu.cn/common-base is Node.js only and provides higher-level CSP-specific building blocks.

Key Features

  • i18n Message Bundles — Local-file-based internationalization with language fallback
  • Standard Error Codes — Structured error codes for infrastructure (DB/API), service, and I/O layers
  • Path Pattern Matching — Trie-based hierarchical URL pattern tester
  • Network Type Definitions — HTTP and Socket protocol interfaces (request payloads, caching, proxy)
  • HTTP Request Utilities — URL params, cookie, header parsing and language detection
  • REST Route Resolution — Dynamic handler lookup with per-method routing and fallback
  • Distributed Tracing — UUID trace ID generation and formatted timestamp strings
  • File I/O Abstractions — Path direction types and buffer descriptors

Modules

| Sub-path | Purpose | |---|---| | @aitianyu.cn/common-base/base | i18n, error codes, pattern matching | | @aitianyu.cn/common-base/network | HTTP & Socket type definitions | | @aitianyu.cn/common-base/utils | HTTP, REST, and trace utility helpers | | @aitianyu.cn/common-base/io | File I/O type definitions |

Quick Start

npm install @aitianyu.cn/common-base @aitianyu.cn/types
import { LocalMessageBundle } from "@aitianyu.cn/common-base/base";
import { HttpHelper, TraceHelper } from "@aitianyu.cn/common-base/utils";
import { HTTP_STATUS_CODE } from "@aitianyu.cn/common-base/network";

const traceId = TraceHelper.generateTraceId();
const params  = HttpHelper.processParameters(req.url);

Detailed Documentation (English)

Read the full English documentation →


中文概述

@aitianyu.cn/common-baseAITianyu Node.js 生态系统的基础公共库,为所有后端 CSP(云服务平台)服务提供可复用的类型定义、接口和工具辅助函数。

@aitianyu.cn/types 的区别: @aitianyu.cn/types 同时支持浏览器和 Node.js 环境,提供基础工具类型。 @aitianyu.cn/common-base 仅支持 Node.js,提供更高层次的 CSP 专用构建基元。

主要功能

  • 国际化(i18n) — 基于本地文件的消息包,支持语言回退
  • 标准错误码 — 覆盖基础设施(数据库/API)、服务层和 I/O 层的结构化错误码
  • 路径模式匹配 — 基于前缀树的分层 URL 路径匹配器
  • 网络类型定义 — HTTP 和 Socket 协议的请求载荷、缓存和代理接口
  • HTTP 请求工具 — URL 参数、Cookie、请求头解析及语言检测
  • REST 路由解析 — 支持方法路由和回退的动态处理器查找
  • 分布式追踪 — UUID 追踪 ID 生成和时间戳格式化
  • 文件 I/O 抽象 — 路径方向类型和缓冲区描述符

模块列表

| 子路径 | 功能 | |---|---| | @aitianyu.cn/common-base/base | i18n、错误码、路径模式匹配 | | @aitianyu.cn/common-base/network | HTTP 和 Socket 类型定义 | | @aitianyu.cn/common-base/utils | HTTP、REST 和追踪工具辅助 | | @aitianyu.cn/common-base/io | 文件 I/O 类型定义 |

快速开始

npm install @aitianyu.cn/common-base @aitianyu.cn/types
import { LocalMessageBundle } from "@aitianyu.cn/common-base/base";
import { HttpHelper, TraceHelper } from "@aitianyu.cn/common-base/utils";
import { HTTP_STATUS_CODE } from "@aitianyu.cn/common-base/network";

const traceId = TraceHelper.generateTraceId();          // 生成追踪 ID
const params  = HttpHelper.processParameters(req.url);  // 解析 URL 参数

详细文档(中文)

阅读完整中文文档 →


License / 许可证

ISC © [email protected]