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

@formulaxjs/kity-runtime

v0.5.1

Published

Legacy KityFormula runtime adapter for FormulaX.

Readme

@formulaxjs/kity-runtime

English | 简体中文

FormulaX 的旧版 KityFormula runtime 适配层。

@formulaxjs/kity-runtime 打包了支撑 FormulaX Kity 编辑与渲染流程的兼容 runtime。它同时包含 runtime 所需的旧版字体、工具栏图片和样式资源,并提供在浏览器应用中挂载编辑器的低层 helper。

状态:实验阶段。在首个稳定版本发布前,公共 API 仍可能调整。

安装

npm install @formulaxjs/kity-runtime

功能概览

  • ensureKityRuntime,用于懒加载 runtime 初始化
  • createKityEditormountKityEditor,用于将 Kity 编辑器挂载到 DOM
  • FormulaXEditor,对低层 runtime handle 提供更易用的 Promise 风格包装
  • 面向既有 KityFormula 集成保留的兼容性导出

示例

import { FormulaXEditor } from '@formulaxjs/kity-runtime';

const editor = new FormulaXEditor({
  el: '#editor', // HTMLElement 或选择器字符串
  initialLatex: 'x=\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}',
  height: 320, // 可选,runtime 工作区高度
  autofocus: true, // 挂载后自动聚焦
  assets: {
    // 可选,当 runtime CSS / 字体 / 工具栏图片放在 CDN 时可局部覆盖
    styles: {
      editor: '/static/formulax/editor.css',
    },
  },
  render: {
    fontsize: 40, // 预览 / 导出字号
  },
});

await editor.execCommand('render', '\\sqrt{x}');
await editor.focus();
await editor.destroy();

包职责

当你需要低层旧版 Kity 编辑 runtime,或者需要兼容历史 KityFormula 行为时,请使用这个包。面向弹窗的编辑流程更推荐使用 @formulaxjs/editormountFormulaXEditor();宿主编辑器集成则优先使用已经依赖该 runtime 的专用 adapter 包。