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

@myfinal/storage

v0.2.5

Published

[Dian](https://github.com/FinalDevHQ/Dian) 框架的存储适配器,支持 SQLite、MySQL、Redis,并提供插件专属的 `PluginStore` 接口。

Readme

@myfinal/storage

Dian 框架的存储适配器,支持 SQLite、MySQL、Redis,并提供插件专属的 PluginStore 接口。

安装

npm install @myfinal/storage

原生模块依赖:better-sqlite3 需要编译工具链。Windows 上需安装 Visual Studio Build Tools,macOS 上 xcode-select --install,Linux 上 build-essential

使用

import { StorageService } from "@myfinal/storage";

const storage = new StorageService();

await storage.init({
  sqlite: "data/dian.db",
  // mysql: "mysql://user:pass@host:3306/db",
  // redis: "redis://localhost:6379",
});

// 消息存储
await storage.messages.save({ botId: "my-bot", ... });
const msgs = await storage.messages.query({ groupId: "123456" });

// 插件专属存储(PluginStore)
const store = storage.getPluginStore("my-plugin");
await store.createTable("my_plugin_data", ["key TEXT", "value TEXT"]);
await store.insert("my_plugin_data", { key: "foo", value: "bar" });
const rows = await store.query("my_plugin_data", { key: "foo" });

适配器

| 适配器 | 说明 | |--------|------| | SQLite | 内置,零配置,数据存于本地文件 | | MySQL | 通过连接字符串配置,适合生产环境 | | Redis | 用于缓存、消息队列等高速读写场景 |

PluginStore 接口

插件专属的 SQLite 表空间,自动隔离,互不干扰。

| 方法 | 说明 | |------|------| | createTable(name, columns) | 创建插件专属表 | | insert(table, data) | 插入数据 | | query(table, params?, options?) | 查询数据,支持 limitorderBy | | delete(table, params?) | 删除数据 |

相关包