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

asai-vue-book

v0.2.10

Published

asai for you

Readme

asai-vue-book — 电子书阅读器

包信息

| 建议 npm 名 | 入口文件 | $fn / 注入键 | 类型 | |------------|---------|-------------|------| | @estun/asai-vue-book | src/index.ts | AsaiVueBookimComp | Feature |

概述

asai-vue-book 提供书架管理与章节阅读,支持分类筛选、搜索、字体/主题调节及可选拼音标注(通过 $fn.AsaiVuePinyin 运行时传入)。

集成方式

// monorepo — 延迟:lib/featurePlugs.ts
import AsaiVueBook from './plugs/asai-vue-book/src/index';
// npm
// import { imComp } from '@estun/asai-vue-book';

const { AsaiBookIndex, AsaiBook } = ujt.$fn.AsaiVueBook;
<AsaiBookIndex :ujt="ujt" />
<AsaiBook :ujt="ujt" :bookdata="{ model: 'book', book: 'id' }" :opt="{ pinyin: true }"
  :AsPinYin="ujt.$fn.AsaiVuePinyin?.AsaiPinYin" />

独立性约束

  • 禁止 cross-import 其它 plugs/*(含 pinyin)。
  • 禁止 import 插件目录外路径;buildCompMap 定义于插件内 src/useCompLoader.ts
  • 拼音组件经 props AsPinYin$fn 注入,不在本包 import pinyin 路径。
  • 数据加载用 $fn.initmodel / $db 运行时 API。

主要 API / 导出

| 导出 | 说明 | |------|------| | imComp.AsaiBookIndex | 书架首页 | | imComp.AsaiBook | 阅读器主体 | | getBookData(bookstr) | use/useBook.ts 格式解析 |

性能说明

  • 延迟加载featurePlugs);子组件 async。
  • 目录侧栏使用 VirtualList 虚拟滚动。
  • 搜索 300ms 节流;书籍 txt 异步加载,失败需业务 catch。
  • 长章逐段渲染 HTML 时注意 DOM 体量。

peerDependencies 建议

{
  "peerDependencies": {
    "vue": "^3.4.0",
    "@estun/asai-js-as": "^1.0.0"
  },
  "optionalPeerDependencies": {
    "@estun/asai-vue-pinyin": "^1.0.0"
  }
}

功能

AsaiBookIndex(书架)

  • 卡片展示、搜索、分类筛选、响应式分页

AsaiBook(阅读器)

  • 多卷/章节导航、内容搜索高亮、字体 12–52px、深/浅色主题
  • 拼音标注(opt.pinyin + AsPinYin prop)
  • 打印样式优化

配置

| 参数 | 说明 | |------|------| | bookdata.model | 数据模块名 | | bookdata.book | 书籍 ID | | opt.html | 是否渲染 HTML | | opt.pinyin | 启用拼音 |

数据格式

interface BookData {
  ch: string;           // 书名
  cc: Volume[];         // 卷宗
}
// Chapter: li, sn, co?, ty?

解析:getBookData() 识别 AsaiBook 标记格式或 rulechanneltobook 规则格式。

文件结构

asai-vue-book/
├── src/index.ts
├── src/useCompLoader.ts
└── src/components/
    ├── AsaiBookIndex.vue / AsaiBook.vue
    └── use/useBook.ts

技术细节

  • $db[model][book] 响应式存储
  • VirtualList + computed 缓存章节列表
  • onBeforeUnmount 清理 watcher