# xterm-addon-fit

> An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables fitting the terminal's dimensions to a containing element. This addon requires xterm.js v4+.

Latest version **0.8.0** (published 2023-09-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install xterm-addon-fit
pnpm add xterm-addon-fit
yarn add xterm-addon-fit
bun add xterm-addon-fit
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2023-09-07 |
| First published | 2019-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21180 |
| Author | The xterm.js authors |
| Maintainers | tyriar |
| Keywords | terminal, xterm, xterm.js |

## Links

- npm: https://www.npmjs.com/package/xterm-addon-fit
- Repository: https://github.com/xtermjs/xterm.js
- Homepage: https://github.com/xtermjs/xterm.js#readme
- Issues: https://github.com/xtermjs/xterm.js/issues
- npm.io page: https://npm.io/package/xterm-addon-fit

## 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.8.0 (latest) — 2023-09-07
- 0.9.0-beta.37 (beta) — 2023-10-31
- 0.9.0-beta.36 — 2023-10-31
- 0.9.0-beta.35 — 2023-10-30
- 0.9.0-beta.34 — 2023-10-19
- 0.9.0-beta.33 — 2023-10-19
- 0.9.0-beta.32 — 2023-10-17
- 0.9.0-beta.31 — 2023-10-13
- 0.9.0-beta.30 — 2023-10-02
- 0.9.0-beta.29 — 2023-10-02
- 0.9.0-beta.28 — 2023-09-27
- 0.9.0-beta.27 — 2023-09-20
- 0.9.0-beta.26 — 2023-09-20
- 0.9.0-beta.25 — 2023-09-16
- 0.9.0-beta.24 — 2023-09-15
- … 104 more at https://npm.io/package/xterm-addon-fit/versions

## README

## xterm-addon-fit

An addon for [xterm.js](https://github.com/xtermjs/xterm.js) that enables fitting the terminal's dimensions to a containing element. This addon requires xterm.js v4+.

### Install

```bash
npm install --save xterm-addon-fit
```

### Usage

```ts
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';

const terminal = new Terminal();
const fitAddon = new FitAddon();
terminal.loadAddon(fitAddon);
terminal.open(containerElement);
fitAddon.fit();
```

See the full [API](https://github.com/xtermjs/xterm.js/blob/master/addons/xterm-addon-fit/typings/xterm-addon-fit.d.ts) for more advanced usage.

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