# @types/utf8

> TypeScript definitions for utf8

Latest version **3.0.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/utf8
pnpm add @types/utf8
yarn add @types/utf8
bun add @types/utf8
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2023-11-07 |
| First published | 2016-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51431 |
| Maintainers | types |

## Links

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

## Recent versions

- 3.0.3 (latest) — 2023-11-07
- 3.0.1 (ts3.8) — 2021-12-24
- 3.0.0 (ts3.5) — 2021-05-20
- 2.1.6 (ts2.0) — 2017-08-21
- 3.0.2 — 2023-10-18
- 2.1.5 — 2016-10-05
- 2.1.4 — 2016-09-19
- 0.0.3 — 2016-08-25
- 0.0.2 — 2016-08-19
- 0.0.1 — 2016-08-02

## README

# Installation
> `npm install --save @types/utf8`

# Summary
This package contains type definitions for utf8 (https://github.com/mathiasbynens/utf8.js).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/utf8.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/utf8/index.d.ts)
````ts
export as namespace utf8;

/**
 * A string representing the semantic version number.
 */
export const version: string;
/**
 * Encodes any given JavaScript string (string) as UTF-8, and returns the UTF-8-encoded version of the string.
 * It throws an error if the input string contains a non-scalar value, i.e. a lone surrogate.
 * @param inputString
 */
export function encode(inputString: string): string;

/**
 * Decodes any given UTF-8-encoded string (byteString) as UTF-8, and returns the UTF-8-decoded version of the string.
 * It throws an error when malformed UTF-8 is detected.
 * @param byteString
 */
export function decode(byteString: string): string;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Piotr Błażejewicz](https://github.com/peterblazejewicz).

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