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

mm_os

v5.0.0

Published

这是OS系统

Downloads

1,200

Readme

mm_os

这是 OS 系统模块,超级美眉服务端的核心框架。负责初始化日志、注册管理、加载输入 / 输出适配器、缓存与数据库、应用加载器,并驱动应用与插件的完整生命周期。

功能特点

  • OS 类:初始化日志、管理、适配器、存储与应用加载器
  • 输入适配器:web / mqtt / socket / websocket
  • 输出适配器:redis / mongodb / mysql / sqlite / jsondb / file
  • 工具与管理:lang / tpl / ret / service / handle / event / api / param / sql / templete / pendant / timer / statics
  • Loader 类:扫描应用目录,加载应用与插件的配置、生命周期和资源清单
  • osAdmin(scope, config) 按作用域缓存系统实例,相同 scope 返回同一实例

安装

npm install mm_os

快速开始

const { osAdmin } = require('mm_os');

const os = osAdmin('os', {
  web: { port: 8080 },
  cache: { type: 'redis' },
  db: { type: 'mysql' }
});

(async () => {
  await os.init();
  await os.start();
})();

API 文档

osAdmin(scope, config)

获取(或创建)指定作用域的系统实例,相同 scope 返回同一实例。

  • scope:作用域名称,缺省为 'os'
  • config:系统配置
    • in_adapters:输入适配器列表,默认 ['web', 'mqtt', 'socket', 'websocket']
    • out_adapters:输出适配器列表,默认 ['redis', 'mongodb', 'mysql', 'sqlite', 'jsondb', 'file']
    • tools:工具列表,默认 ['lang', 'tpl', 'ret', 'service', 'handle']
    • admins:管理列表,默认 ['event', 'api', 'param', 'sql', 'templete', 'pendant', 'timer', 'statics']
    • cache / db:缓存与数据库配置
    • web / mqtt / socket / websocket:各入站适配器端口配置

OS

| 方法 | 说明 | | --- | --- | | onInit() | 生命周期初始化钩子,依次初始化日志、管理、适配器、存储与加载器 | | initLogger() | 初始化日志记录器 | | log(type, msg, ...args) | 输出日志 | | reg(name, admin) | 注册管理对象 | | require(mod_name) | 加载模块 | | initAdapter() | 初始化输入 / 输出适配器并初始化事件总线 | | initTools() | 初始化工具 | | initAdmins() | 初始化管理 | | initpStorage() | 初始化缓存与数据库 | | initLoader() | 初始化应用加载器 | | initEventBus() | 初始化事件总线 | | start() | 启动全部适配器、缓存、数据库与应用 |

OS 实例属性:admins、in_adapters、out_adapters、cache、sql、logger、loader、eventer。

Loader

| 方法 | 说明 | | --- | --- | | load() | 扫描并加载应用根目录下的全部应用 | | startAll() | 启动全部应用 | | stopAll() | 停止全部应用 | | get(name) | 获取应用驱动 | | has(name) | 判断应用是否存在 | | list() | 获取应用驱动列表 | | reload(name) | 重启应用 | | del(name) | 删除应用 | | clear() | 清空应用列表与资源管理器缓存 |

admin

内置的 Admin 实例,已注册 OS 类。

运行示例

npm run demo

许可证

ISC License

作者

邱文武