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

@quick-qui/model-server

v1.5.0

Published

负责载入、解析、维护和发布模型。 关于模型的各种规则和计算在此执行 (但不在此定义,定义见 [@quick-qui/model-defines](http://github.com/quickqui/model-defines)。)

Downloads

96

Readme

@quick-qui/model-server

负责载入、解析、维护和发布模型。 关于模型的各种规则和计算在此执行 (但不在此定义,定义见 @quick-qui/model-defines。)

相关概念

  1. 模型库(repository) 与模型源、模型文件共同组成模型的描述系统。一个模型库一般对应一个模型空间,也就是一个系统的全部模型描述。一个模型库有一个主要的模型源,可能是文件夹、url 地址等等形式,一个模型源可以包含(include)其他源。每个模型源包含多个模型文件。模型文件按类似于文件夹的形式树形组织,不同文件夹内的模型文件对应不同的命名空间。
  2. 模型源(source) (见上条)
  3. 模型文件(file) (见上条)
  4. 包含(include) - 一个模型源可以包含一个或多个其他源,也就是一个模型库包含多个源。
  5. 日志(log) - 载入、解析、合并、编织等活动都有详尽记录。

如何工作

  1. 作为 node 服务运行起来。
  2. 从模型库(repository)地址加载模型源文件。
  3. 如果有导入(include),则加载被导入的模型源。
  4. 根据源文件的特征载入对应的模型定义。(模型定义为可扩展,详见 @quick-qui/model-defines
  5. 所有的源文件验证(validate)以后解析为模型片段,合并到模型空间中。此处的验证是对源文件和片段的局部验证。
  6. 验证,特别是在模型空间范围的合法性。
  7. 编织(weave)。
  8. 处理完毕的常驻,随时可以查询,除非人为触发刷新(refresh),不会重新载入处理。
  9. 处理过程有记录,可以通过接口查询。

如何运行

  1. 作为node服务单独运行 - npm start
  2. 作为@quick-qui/builder的一部分运行,其背后也是通过子进程调用1.的方式。
  3. 作为“成品运行时“的一部分运行,其运行方式根据launcher类型的不同而不同。详细见@quick-qui/launcher相关说明。

所需环境

| | | | | | ---------- | -------- | ------------------- | -------------------------------------------------- | | MODEL_PATH | 环境变量 | string, 必填。 | 指出模型项目所在的路径。本地路径,可以是相对路径。 | | PORT | 环境变量 | int,可选,默认1111 | 服务监听的端口。 | | | | | |

接口

| | URL | 方法 | 参数 | 说明 | | ------------------------ | ------------------------ | ---- | ------------------ | ------------------------------------------------------------------ | | 获取模型列表 | /models | GET | | 🏃(目前没有明确定义模型 id,只能使用“default”作为 id) | | 获取模型对象 | /models/:id | GET | id:string, 模型 id | 如果返回 404,可能是模型载入不成功,可获取对应的日志查看具体原因。 | | 获取载入过程日志 | /models/:id/logs | GET | | | | 获取模型对应的模型源信息 | /models/:id/modelSources | GET | | | | 刷新模型 | /models/:id/refresh | POST | | 下次 get 的时候会重新运行载入全过程 |