# @xterm/addon-ligatures

> Add support for programming ligatures to xterm.js

Latest version **0.10.0** (published 2025-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @xterm/addon-ligatures
pnpm add @xterm/addon-ligatures
yarn add @xterm/addon-ligatures
bun add @xterm/addon-ligatures
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score; popular repo.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.10.0 |
| Published | 2025-12-22 |
| First published | 2023-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >8.0.0 |
| Dependencies | 2 |
| Unpacked size | 1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21303 |
| Author | The xterm.js authors |
| Maintainers | tyriar |
| Keywords | font, ligature, terminal, xterm, xterm.js |

## Links

- npm: https://www.npmjs.com/package/@xterm/addon-ligatures
- Repository: https://github.com/xtermjs/xterm.js.git#master
- Homepage: https://github.com/xtermjs/xterm.js/tree/master#readme
- Issues: https://github.com/xtermjs/xterm.js/issues
- npm.io page: https://npm.io/package/@xterm/addon-ligatures

## Dependencies (2)

- [font-finder](https://npm.io/package/font-finder.md) ^1.1.0
- [font-ligatures](https://npm.io/package/font-ligatures.md) ^1.4.1

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.10.0 (latest) — 2025-12-22
- 0.11.0-beta.330 (beta) — 2026-10-29
- 0.11.0-beta.329 — 2026-10-29
- 0.11.0-beta.328 — 2026-10-29
- 0.11.0-beta.327 — 2026-10-29
- 0.11.0-beta.326 — 2026-10-29
- 0.11.0-beta.325 — 2026-10-29
- 0.11.0-beta.324 — 2026-10-29
- 0.11.0-beta.323 — 2026-10-29
- 0.11.0-beta.322 — 2026-10-29
- 0.11.0-beta.321 — 2026-10-29
- 0.11.0-beta.320 — 2026-10-29
- 0.11.0-beta.319 — 2026-10-29
- 0.11.0-beta.318 — 2026-10-29
- 0.11.0-beta.317 — 2026-10-28
- … 507 more at https://npm.io/package/@xterm/addon-ligatures/versions

## README

## @xterm/addon-ligatures

Add support for programming ligatures to [xterm.js] when running in environments with access to [Node.js] APIs (such as [Electron]).

### Requirements

 * [Node.js] 8.x or higher (present in [Electron] 1.8.3 or higher)
 * [xterm.js] 4.0.0 or higher using the default canvas renderer

### Install

```bash
npm install --save @xterm/addon-ligatures
```

### Usage

```ts
import { Terminal } from '@xterm/xterm';
import { LigaturesAddon } from '@xterm/addon-ligatures';

const terminal = new Terminal();
const ligaturesAddon = new LigaturesAddon();
terminal.open(containerElement);
terminal.loadAddon(ligaturesAddon);
```

### How It Works

In a browser environment, font ligature information is read directly by the web browser and used to render text correctly without any intervention from the developer. As of version 3, xterm.js uses the canvas to render characters individually, resulting in a significant performance boost. However, this means that it can no longer lean on the browser to determine when to draw font ligatures.

This package locates the font file on disk for the font currently in use by the terminal and parses the ligature information out of it (via the [font-ligatures] package). As text is rendered in xterm.js, this package annotates it with the locations of ligatures, allowing xterm.js to render it correctly.

Since this package depends on being able to find and resolve a system font from disk, it has to have system access that isn't available in the web browser. As a result, this package is mainly useful in environments that combine browser and Node.js runtimes (such as [Electron]).

### Fallback Ligatures

When ligatures cannot be fetched from the environment, a set of "fallback" ligatures is used to get the most common ligatures working. These fallback ligatures can be customized with options passed to `LigatureAddon.constructor`.

### Fonts

This package makes use of the following fonts for testing:

* [Fira Code][Fira Code] - [Licensed under the OFL][Fira Code License] by Nikita Prokopov, Mozilla Foundation with reserved names Fira Code, Fira Mono, and Fira Sans
* [Iosevka] - [Licensed under the OFL][Iosevka License] by Belleve Invis with reserved name Iosevka

[xterm.js]: https://github.com/xtermjs/xterm.js
[Electron]: https://electronjs.org/
[Node.js]: https://nodejs.org/
[font-ligatures]: https://github.com/princjef/font-ligatures
[Fira Code]: https://github.com/tonsky/FiraCode
[Fira Code License]: https://github.com/tonsky/FiraCode/blob/master/LICENSE
[Iosevka]: https://github.com/be5invis/Iosevka
[Iosevka License]: https://github.com/be5invis/Iosevka/blob/master/LICENSE.md

---
_Source: https://npm.io/package/@xterm/addon-ligatures · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
