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

@bhshen2025/xstatetonpm

v0.0.1

Published

npm init -y

Downloads

124

Readme

测试

npm init -y

npm install typescript @types/node -D # TS 基础依赖 npm install vite -D # 打包工具(或选 tsc) npm install --save-dev vite-plugin-dts #打包时生成.d.ts文件插件 npm install --save-dev vite-plugin-node-polyfills npm install --save-dev cross-env //windows测试运行需要组件 npm install --save-dev ts-node jest @types/jest mocha chai @types/mocha @types/chai //测试 npm install @bufbuild/protobuf @bufbuild/buf --save-dev // TS使用的protobuf npm install @scure/base base58库 https://www.npmjs.com/package/buffer buffer库 https://www.npmjs.com/package/mitt 事件库 event

package.json "scripts": { "build": "tsc && vite build", // 使用 Vite 打包(或仅 tsc) "test": "jest" }, "main": "dist/ts-network-module.umd.js", // UMD 格式入口 "module": "dist/ts-network-module.es.js", // ES 模块入口 "types": "dist/index.d.ts", // 类型声明入口

node版本 22.13.1 因为vite5 需要20+的node版本

构建本地测试包方法

npm run build # 构建 npm pack # 生成 .tgz 包 npm pack --pack-destination=./tgz 指定 .tgz 文件的输出目录(默认当前目录) ​输出​:生成 [package-name]-[version].tgz 文件(如 my-lib-1.0.0.tgz) 。 ​依据​:package.json 中的 name 和 version 字段决定文件名 npm install ./ts-network-module-1.0.0.tgz # 在另一个项目测试

gitlab

创建项目​:在 GitLab 创建私有项目(如 my-group/ts-network-module)。 ​获取 Token​: 项目->设置->仓库->部署令牌

设置token

环境变量里面 GITLAB_CARINA_TOKEN "your token" set GITLAB_CARINA_TOKEN "your token"

powershell 里面

$env:GITLAB_CARINA_TOKEN = "new_value"

命令行配置

npm config set -- //gitlab.ixiaqi.vip/api/v4/projects/<项目ID>/packages/npm/:_authToken=your token

检查环境变量的token

echo $env:GITLAB_CARINA_TOKEN

发布包配置 package.json

"publishConfig": { "@carina-web-sdk:registry": "https://gitlab.ixiaqi.vip/api/v4/projects/<项目ID>/packages/npm/" }

发布包配置 .npmrc.json

@<项目组名>:registry=https://gitlab.ixiaqi.vip/api/v4/projects/<项目ID>/packages/npm/ //gitlab.ixiaqi.vip/api/v4/projects/<项目ID>/packages/npm/:_authToken=${GITLAB_CARINA_TOKEN}

发布

npm publish

安装

@<项目组名>:registry=https://gitlab.ixiaqi.vip/api/v4/projects/<项目ID>/packages/npm/ //gitlab.ixiaqi.vip/api/v4/projects/<项目ID>/packages/npm/:_authToken=${GITLAB_CARINA_TOKEN} npm install @client_node_modules/ts-socket 旧 npm install @carina-web-sdk/ts-socket 新

生成proto文件

把.proto文件放在 src/protobuf 下 然后执行命令 npx buf generate src/protobuf //生成文件

发布流程

npm run build # 构建 npm publish # 发布

测试

运行npm mochatest 测试相关再test文件夹下面