# @types/string-pixel-width

> TypeScript definitions for string-pixel-width

Latest version **1.11.0** (published 2025-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/string-pixel-width
pnpm add @types/string-pixel-width
yarn add @types/string-pixel-width
bun add @types/string-pixel-width
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.11.0 |
| Published | 2025-11-20 |
| First published | 2019-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51353 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/string-pixel-width
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-pixel-width
- npm.io page: https://npm.io/package/@types/string-pixel-width

## Recent versions

- 1.11.0 (latest) — 2025-11-20
- 1.10.3 (ts4.5) — 2023-11-07
- 1.10.0 (ts4.1) — 2022-11-07
- 1.7.2 (ts3.6) — 2021-07-02
- 1.7.1 (ts3.1) — 2020-05-15
- 1.7.0 (ts2.0) — 2019-04-29
- 1.10.2 — 2023-10-18
- 1.10.1 — 2023-09-25

## README

# Installation
> `npm install --save @types/string-pixel-width`

# Summary
This package contains type definitions for string-pixel-width (https://github.com/adambisek/string-pixel-width#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-pixel-width.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-pixel-width/index.d.ts)
````ts
export = getWidth;

declare function getWidth(string: string, settings?: getWidth.Settings): number;

declare namespace getWidth {
    interface Settings {
        bold?: boolean | undefined;
        font?:
            | "andale mono"
            | "arial"
            | "avenir"
            | "avenir next"
            | "comic sans ms"
            | "courier new"
            | "georgia"
            | "helvetica"
            | "impact"
            | "inter"
            | "times new roman"
            | "trebuchet ms"
            | "verdana"
            | "webdings"
            | "open sans"
            | "tahoma"
            | "quantify"
            | undefined;
        italic?: boolean | undefined;
        size?: number | undefined;
    }
}

````

### Additional Details
 * Last updated: Thu, 20 Nov 2025 18:41:42 GMT
 * Dependencies: none

# Credits
These definitions were written by [Graham Dyson](https://github.com/grahamdyson).

---
_Source: https://npm.io/package/@types/string-pixel-width · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
