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

hm-pinus-parse-interface

v1.0.5

Published

解析 ts 的interface 到 pinus-protobuf用的 json格式。

Readme

parse TS interface to TS pinus-protobuf

解析ts的 interface 到ts格式的 pinus-protobuf 。

pinus: https://github.com/node-pinus/pinus

changelog

v1.0.0:
将pinus-parse-interface模块私有化

v1.0.1:
定制项目框架解析需求

v1.0.2:
支持单文件多个路由接口解析

v1.0.3:
修复在handler会生成push路由的问题
add(parse):分为handler和push解析
1、parseHandlerToPinusProtobuf
2、parsePushToPinusProtobuf
3、parseHandlerFile
4、parsePushFile

v1.0.4:
更新README.md

v1.0.5:
add(parse): 修改类型解析机制
1、去掉additionalProperties属性 用format替换
2、新增数组和基础属性统一优先用format表示type
3、number默认 int32
4、需要double的地方需要显示增加注释`/** @format double */`替换

install

npm install hm-pinus-parse-interface

or

yarn add hm-pinus-parse-interface

usage

const main = require('hm-pinus-parse-interface');

const test = main.parseToPinusProtobuf('path_to_you_interface_dir');
console.log('result',JSON.stringify(test,null,4));

interface 结构约定

  1. 俩层目录结构。
  2. 第一层服务器名为目录名。
  3. 第二层Handler或者Push名为目录名。
  4. 请求和响应文件.req.res结尾。
  5. 推送文件.push结尾。
  6. 客户端请求消息接口命名Req结尾。
  7. 服务器响应消息接口命名Res结尾,其余命名部分要和客户端一致。
  8. 服务器推送消息接口命名On开头。

例如:百人牛牛

百人牛牛请求和响应文件名: brnn.req.res.ts

brnn.req.res.ts文件内容:

export interface DoBetReq {
    area: number; // 区域类型
    index: number; // 筹码索引
    /** @format double */
    value?: number; // 筹码值
}

export interface DoBetRes extends BaseRes {
    data?: DoBetData;
}

百人牛牛推送文件名: brnn.push.ts

brnn.push.ts文件内容:

/**
 * 推送玩家下注消息
 */
export interface OnBet {
    userId: string;
    index: number; // 筹码索引
    /** @format double */
    value: number; // 筹码值
    area: number; // 区域类型
    /** @format double */
    areaTotalValue: number; // 当前区域总值
    /** @format double */
    totalValue: number; // 所有区域总值
}

auto generate

serverProtos.ts,clientProtos.ts,dictionary.ts,routes.ts

说明:需要自定义生成脚本逻辑,只供内部使用