# font-fit

> A fast, lightweight library for sizing text-content to fit.

Latest version **0.3.7** (published 2015-12-16) · 0 weekly downloads

## Install

```sh
npm install font-fit
pnpm add font-fit
yarn add font-fit
bun add font-fit
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.7 |
| Published | 2015-12-16 |
| First published | 2015-12-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | wilsonpage |

## Links

- npm: https://www.npmjs.com/package/font-fit
- Repository: https://github.com/fxos-components/font-fit
- Issues: https://github.com/fxos-components/font-fit/issues
- npm.io page: https://npm.io/package/font-fit

## Recent versions

- 0.3.7 (latest) — 2015-12-16
- 0.3.6 — 2015-12-02
- 0.3.5 — 2015-12-02
- 0.3.4 — 2015-12-02
- 0.3.3 — 2015-12-01

## README

# font-fit [![](https://travis-ci.org/fxos-components/font-fit.svg)](https://travis-ci.org/fxos-components/font-fit)

A fast, lightweight library for sizing text-content to fit.

## Demo

- [Demo](http://fxos-components.github.io/font-fit/)

## Installation

```bash
$ npm install font-fit
```

## Usage

```js
var result = fontFit({
  text: 'hello world',
  font: 'italic 24px arial',
  space: myElement.clientWidth, // space for text,
  min: 16, // min font-size (optional)
  max: 24 // max font-size (optional)
});

myElement.style.fontSize = result.fontSize + 'px';
```

## Tests

1. Ensure Firefox Nightly is installed on your machine.
2. `$ npm install`
3. `$ npm test`

If your would like tests to run on file change use:

`$ npm run test-dev`

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