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 🙏

© 2025 – Pkg Stats / Ryan Hefner

koishi-plugin-typbot-render

v0.2.2

Published

A plugin for rendering Typst markup, script and math formulas using local Typst CLI.

Readme

koishi-plugin-typbot-render

npm

Koishi 插件,用于渲染 Typst 标记、脚本和数学公式。使用本地 Typst CLI 进行高效渲染,无需依赖网络服务。

功能特点

  • 支持三种渲染模式:标记模式、脚本模式和数学模式
  • 使用本地 Typst CLI 进行高质量渲染
  • 支持自定义文字颜色、字体大小、宽度和高度
  • 直接输出 base64 编码的图片,无需保存临时文件
  • 提供简洁的命令别名:/typ/typc/teq

安装前提

使用本插件前,请确保您的系统已安装 Typst CLI。

在 macOS 上安装 Typst

brew install typst

在 Windows 上安装 Typst

可以从 Typst 官方网站GitHub 发布页面 下载安装程序。

使用方法

标记模式

/typ Hello World!

脚本模式

/typc "Hello, world!"

数学模式

/teq x^2 + y^2 = z^2

命令选项

所有命令都支持以下选项:

  • -f, --fg <color>: 设置文字颜色
  • -s, --size <size>: 设置字体大小
  • -w, --width <width>: 设置宽度(auto 或数字)
  • --height <height>: 设置高度(auto 或数字)

例如:

/typ -f "blue" -s 20 -w 400 Hello World!

配置项

  • tempPath: 临时文件保存路径
  • debug: 是否开启调试模式(开启后会保存 Typst 源码)
  • timeout: 渲染超时时间 (ms)
  • color: 默认文字颜色(支持十六进制格式如 #FF0000 或命名颜色如 red
  • fontSize: 默认字体大小(单位:pt)
  • width: 默认宽度(auto 或具体数值,单位:pt)
  • height: 默认高度(auto 或具体数值,单位:pt)
  • dpi: 渲染图片的 DPI(影响图片清晰度)

技术实现

本插件通过直接调用本地 Typst CLI 进行渲染,使用标准输入/输出流传递数据,避免了创建临时文件的开销。渲染结果以 base64 编码的 PNG 图片形式返回,可直接在聊天中显示。

依赖说明

  • 本插件需要系统中已安装 Typst CLI
  • 不再依赖 puppeteer,渲染效率更高

贡献指南

欢迎提交 Issues 和 Pull Requests 来改进此插件。请确保您的代码遵循项目的编码规范。

许可证

MIT