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

@drghaliasri/butex

v8.2.0

Published

MathJax extension layer for Arabic-friendly math notation (XeLaTeX-like customs beyond plain MathJax)

Readme

BuTeX

BuTeX (@drghaliasri/butex) provides Arabic mathematical typography and structured equation/document editing on MathJax 4. It ships an AST-first equation editor, canonical Document model, React editors/previews and a stateless Node document worker.

MathJax is an external peer dependency, not bundled as a vendored upstream source tree. See MathJax's upstream source for the reference implementation; package.json specifies the runtime peer dependency.

Install

npm install @drghaliasri/butex mathjax
# Add these if using the React editors:
npm install react react-dom

Node.js 20+ is required for tooling/worker usage. MathJax ^4.1.0 is a peer dependency; React and ReactDOM 18/19 are optional peers. package.json defines current versions, supported imports and CLI names.

Public entrypoints

| Import / executable | Implemented purpose | | --- | --- | | @drghaliasri/butex | Core Arabic MathJax macros, parseBuTeX, registration, math-island rendering | | @drghaliasri/butex/react | Standalone ButexEditor equation editor | | @drghaliasri/butex/document | DocumentJson, commands, import/export, outline, validation, diff | | @drghaliasri/butex/react-document | ButexDocumentEditor editor | | @drghaliasri/butex/react-document-preview | Lightweight read-only ButexDocumentPreview | | butex-document | Stateless stdin / authenticated HTTP worker |

The completed Document2 → Document migration retired the first-generation editor and promoted the maintained model, worker and React editor to the unversioned names above. These are the current 8.0.3 package interfaces, not pending migration-branch APIs. See the post-fix verification for evidence and release qualifications.

MathJax setup

Use MathJax 4 tex-chtml.js or tex-svg.js, matching the chtml / svg output mode. Configure the butex-arabic-math TeX package and call registerBuTeX before MathJax startup completes. Use registerBuTeXSvgTextWrapper after startup initialization for SVG-specific Arabic text behavior.

import { registerBuTeX, injectBuTeXStyles } from '@drghaliasri/butex';

// Inside your host's MathJax startup.ready integration:
registerBuTeX(MathJax);
injectBuTeXStyles();
// Then complete the chosen MathJax component's startup.

See math/rendering architecture for initialization and semantic/visual RTL rules. parseBuTeX is a small Arabic-friendly surface preprocessor, not a general LaTeX-to-structured-AST parser.

Document model basics

import {
  createEmptyDocument,
  fromDocumentJson,
  toDocumentJson,
  validateDocument,
} from '@drghaliasri/butex/document';

const document = createEmptyDocument();
const validation = validateDocument(document);
const saved = toDocumentJson(document);
const restored = fromDocumentJson(saved);

Use ButexDocumentEditor from @drghaliasri/butex/react-document for the interactive editor; use ButexDocumentPreview from @drghaliasri/butex/react-document-preview to show read-only snapshots.

Renaming an enabled figure/table label with update_float_meta also updates matching \ref/\eqref tokens throughout the document in the same edit; disabling or clearing a label leaves references unchanged.

Host responsibility: authentication, article permissions, immutable revisions, image uploads/storage, compilation and publishing. BuTeX supplies pure Document transformations and editing UI, never an article database or MCP authorization bypass. See Document, React integration, and the worker.

Development and demos

npm ci
npm run build
npm run typecheck
npm run lint
npm test

The equation-editor demo is demo/editor-app/; the modern document editor is demo/document-editor-app/; the first-generation demo was replaced by the promoted modern demo at the canonical path. Read local development and verification.

Book authoring — proposed only

The BuTeX book design and Al-Bayan integration plan describe future multi-chapter editing, scoped references and whole-book export. Book/editor/worker APIs in those plans do not ship today.

Documentation

  • Architecture — implemented package and host contracts
  • Development — building, browser testing and releases
  • Proposals — book authoring and completed Document migration evidence
  • Archive — historical design records

The npm tarball includes dist/ and this README; docs/ live in the GitLab repository.

License

See the license field in package.json.