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

texlyre-busytex

v0.1.2-alpha

Published

Run LaTeX compilation (pdflatex, xelatex, lualatex) in the browser using WebAssembly

Readme

TeXlyre BusyTeX

Run LaTeX compilation directly in your browser using WebAssembly. Supports XeLaTeX, PdfLaTeX, and LuaLaTeX with BibTeX integration.

npm version License: MIT

Live Demo | GitHub

Features

  • XeLaTeX: Compile with XeTeX engine + bibtex8 + dvipdfmx
  • PdfLaTeX: Compile with PdfTeX engine + bibtex8
  • LuaLaTeX: Compile with LuaHBTeX engine + bibtex8
  • Multi-file Support: Handle complex projects with multiple .tex and .bib files
  • SyncTeX: Generate SyncTeX files for editor synchronization
  • Browser-based: All compilation runs entirely in the browser with no server required
  • Web Worker Support: Non-blocking compilation using Web Workers

Installation

npm install texlyre-busytex

Download Assets

BusyTeX requires WASM files (~175MB) that are hosted on GitHub Releases:

# Download to default location (./public/core)
npx texlyre-busytex download-assets

# Or specify custom location
npx texlyre-busytex download-assets ./static/wasm
npx texlyre-busytex download-assets ./public/assets

Assets will be downloaded to <destination>/busytex/ directory.

Usage

Basic Example

import { BusyTexRunner, XeLatex } from 'texlyre-busytex';

const runner = new BusyTexRunner({
  busytexBasePath: '/core/busytex'
});

await runner.initialize();

const xelatex = new XeLatex(runner);
const result = await xelatex.compile({
  input: `\\documentclass{article}
\\usepackage{amsmath}

\\begin{document}
\\section{Introduction}
Hello, LaTeX!

\\begin{equation}
E = mc^2
\\end{equation}
\\end{document}`
});

if (result.success && result.pdf) {
  const blob = new Blob([result.pdf], { type: 'application/pdf' });
  const url = URL.createObjectURL(blob);
  window.open(url);
}

With BibTeX

const result = await xelatex.compile({
  input: `\\documentclass{article}
\\begin{document}
\\cite{sample2023}
\\bibliographystyle{plain}
\\bibliography{references}
\\end{document}`,
  bibtex: true,
  additionalFiles: [
    {
      path: 'references.bib',
      content: `@article{sample2023,
  title={Sample Article},
  author={Author, John},
  year={2023}
}`
    }
  ]
});

Multi-file Projects

const result = await xelatex.compile({
  input: `\\documentclass{article}
\\begin{document}
\\input{chapter1.tex}
\\input{chapter2.tex}
\\end{document}`,
  additionalFiles: [
    {
      path: 'chapter1.tex',
      content: '\\section{Chapter 1}\nContent...'
    },
    {
      path: 'chapter2.tex',
      content: '\\section{Chapter 2}\nContent...'
    }
  ]
});

Using PdfLaTeX or LuaLaTeX

import { PdfLatex, LuaLatex } from 'texlyre-busytex';

const pdflatex = new PdfLatex(runner);
const result = await pdflatex.compile({ input: '...' });

const lualatex = new LuaLatex(runner);
const result2 = await lualatex.compile({ input: '...' });

With Web Worker

const runner = new BusyTexRunner({
  busytexBasePath: '/core/busytex',
  verbose: true
});

await runner.initialize(true); // true = use Web Worker

SyncTeX Support

const result = await xelatex.compile({ input: '...' });

if (result.synctex) {
  const blob = new Blob([result.synctex], { type: 'application/gzip' });
  const url = URL.createObjectURL(blob);
  
  const link = document.createElement('a');
  link.href = url;
  link.download = 'main.synctex.gz';
  link.click();
}

API Reference

BusyTexRunner

constructor(config?: BusyTexConfig)

Config Options:

  • busytexBasePath: Path to BusyTeX assets (default: '/core/busytex')
  • verbose: Enable verbose logging (default: false)

Methods:

  • initialize(useWorker?: boolean): Promise<void> - Initialize the runner
  • isInitialized(): boolean - Check if initialized
  • terminate(): void - Clean up resources

XeLatex, PdfLatex, LuaLatex

constructor(runner: BusyTexRunner, verbose?: boolean)
compile(options: CompileOptions): Promise<CompileResult>

CompileOptions:

  • input: Main LaTeX document content
  • bibtex?: Enable BibTeX compilation (default: false)
  • verbose?: Verbosity level - 'silent', 'info', or 'debug' (default: 'silent')
  • additionalFiles?: Array of { path: string, content: string }

CompileResult:

  • success: Compilation succeeded
  • pdf?: PDF output as Uint8Array
  • synctex?: SyncTeX output as Uint8Array
  • log: Compilation log
  • exitCode: Process exit code
  • logs: Detailed log entries

Development

Clone and Setup

git clone https://github.com/TeXlyre/texlyre-busytex.git
cd texlyre-busytex
npm install
npm run download-assets
npm run build

Run Example

npm run example

Then open http://localhost:3000

Upload Assets (Maintainers)

# Create archive and upload to GitHub Releases
npm run upload-assets

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Development Workflow

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Download assets: npm run download-assets
  4. Make your changes
  5. Build: npm run build
  6. Test with example: npm run example
  7. Commit your changes (git commit -m 'Add amazing feature')
  8. Push to the branch (git push origin feature/amazing-feature)
  9. Open a Pull Request

Limitations

This is an experimental build of TeXLive 2025 with the intent of integration into TeXlyre. Sustained work on this package is not guaranteed and major changes may be introduced at any time.

Besides bibtex8, pdftex, luatex, xetex, dvipdf, other packages are not included. Additionally, some fonts, as well as external scripts called through shell-escape are not available.

License

MIT License © Fares Abawi

This project uses BusyTeX WASM, which is also licensed under the MIT license.

Acknowledgments

Built with BusyTeX - A WebAssembly port of TeX Live.