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

@masx200/mathjax-module-async

v1.6.0

Published

把mathjax转化成模块形式异步加载导出,并且不会污染全局变量

Downloads

12

Readme

mathjax-module-async

介绍

浏览器中使用的,

mathjax 转化成模块形式异步加载导出,并且不会污染全局变量

支持输入: asciimath,latex,mathml

支持输出: chtml

导出几个方法,把输入的数学公式,渲染成元素,添加到容器中,

不会在加载时自动渲染文档中所有公式

基于 MathJax 版本 3.2.2

加载了以下模块:

[
    "startup",
    "core",
    "input/asciimath",
    "output/chtml",
    "input/tex-full",
    "input/mml",
    "output/chtml/fonts/tex"
]

由于使用了Proxy,所以支持的浏览器必须支持 ES2015

删除了arguments.callee,使用 rollup 打包

https://github.com/mathjax/MathJax-src/issues/850

https://github.com/masx200/MathJax-src

https://github.com/masx200/MathJax

在线演示

https://mathjax-module-async.vercel.app/

https://mathjax-module-async-masx200.netlify.app/

安装教程


yarn add "@masx200/mathjax-module-async"

使用说明

import { rendermath, initmathjax } from "@masx200/mathjax-module-async";

API

类型声明文件

https://github.com/masx200/mathjax-module-async/blob/master/lib/index.ts

rendermath

异步方法,把输入的 数学 格式的文字渲染,并返回 html 字符串。

参数:MathJax:MathJax对象

参数:input:数学公式的文本内容

参数:type:数学公式使用的语言是 "latex" | "mathml" | "asciimath"之一

参数:opts:可选参数,传递给渲染函数mathml2chtmlPromise,asciimath2chtmlPromise,tex2chtmlPromise之一的参数,可以通过MathJax.getMetricsFor获取

返回值为Promise<string>,渲染后的数学公式的html文本。

initmathjax

异步加载 MathJax 并返回 MathJax

参数:baseurl:mathjax的起始网址,默认为https://unpkg.com/[email protected]/es5