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

asaihost-nodejs-dbsqlite

v0.0.1

Published

AsaiWeb CMS SQLite database driver plugin for asaihost-nodejs sysserver

Readme

asaihost-nodejs-dbsqlite

asaihost-nodejs 的 SQLite 数据库驱动插件:单连接串行队列、可选连接池、WAL 模式、缺表自动建表。

| 项 | 值 | |----|-----| | npm 包名 | asaihost-nodejs-dbsqlite | | 插件入口 | index.ts(monorepo 源码)/ dist/asaihost-nodejs-dbsqlite.es.js(发布后) | | 运行时依赖 | sqlite3 ^6.0(含 native binding,需 node-gyp 编译环境) | | Node 版本 | >= 20 |


安装

npm install asaihost-nodejs asaihost-nodejs-dbsqlite

Windows / Linux 首次安装 sqlite3 若编译失败,请先安装 node-gyp 前置工具链,详见 SQLite.md


用法

驱动以 factory 函数 导出,由 asaihost-nodejssysserver 注入:

import AsaiHostNodejs from 'asaihost-nodejs';
import AsaiHostNodejsDbsqlite from 'asaihost-nodejs-dbsqlite';

AsaiHostNodejs.sysserver($asai, {
  db: { sqlite: AsaiHostNodejsDbsqlite },
});

asaihost.json 或业务配置中指定 type: "sqlite" 即可使用该驱动。

配置示例

{
  "type": "sqlite",
  "opt": {
    "database": "./webdata/webdb/app.db",
    "create": true,
    "busyTimeout": 10000
  }
}

| 字段 | 说明 | |------|------| | database | SQLite 文件路径(目录不存在时自动创建) | | create | 为 true 时,insert 遇缺表则自动建表 | | usePool | 为 true 时启用连接池(默认单连接 + 串行队列,推荐) | | poolMin / poolMax | 连接池大小(SQLite 同文件建议 poolMax: 1) | | busyTimeout | SQLITE_BUSY 等待毫秒数,默认 10000 | | acquireTimeout | 获取连接超时,默认 15000 |


在 AsaiCMS monorepo 内使用

开发时直接引用源码,无需先 npm pack

import AsaiHostNodejsDbsqlite from './src/plugs/asaihost-nodejs-dbsqlite/index';

开发与发布 npm 包

cd webserver/src/plugs/asaihost-nodejs-dbsqlite
npm install
npm run typecheck
npm run build
npm pack              # 本地验证 .tgz 内容
npm publish --access public

package.json exports 约定

| 条件 | 解析到 | |------|--------| | development | ./index.ts(monorepo + tsx 开发) | | import | ./dist/asaihost-nodejs-dbsqlite.es.js | | require | ./dist/asaihost-nodejs-dbsqlite.cjs | | types | ./dist/asaihost-nodejs-dbsqlite.d.ts |


SQLite 参考

安装前置与 SQL 语法说明见 SQLite.md


asaihost-nodejs 配对使用;禁止跨插件 deep import。