# encode-utf8

> Turn a string into an ArrayBuffer by using the UTF8 encoding.

Latest version **2.0.0** (published 2021-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install encode-utf8
pnpm add encode-utf8
yarn add encode-utf8
bun add encode-utf8
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-07-24 |
| First published | 2017-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Maintainers | linusu |

## Links

- npm: https://www.npmjs.com/package/encode-utf8
- Repository: https://github.com/LinusU/encode-utf8
- Homepage: https://github.com/LinusU/encode-utf8#readme
- Issues: https://github.com/LinusU/encode-utf8/issues
- npm.io page: https://npm.io/package/encode-utf8

## Recent versions

- 2.0.0 (latest) — 2021-07-24
- 1.0.3 — 2020-03-30
- 1.0.2 — 2018-04-30
- 1.0.1 — 2017-11-01
- 1.0.0 — 2017-10-31

## README

# Encode UTF8

Turn a string into an ArrayBuffer by using the UTF8 encoding.

## Installation

```js
npm install --save encode-utf8
```

## Usage

```js
import encodeUtf8 from 'encode-utf8'

console.log(encodeUtf8('Hello, World!'))
//=> ArrayBuffer { byteLength: 13 }

console.log(encodeUtf8('🐵 🙈 🙉 🙊'))
//=> ArrayBuffer { byteLength: 19 }
```

## API

### `encodeUtf8(input)`

- `input` (`string`, required)
- returns `ArrayBuffer` - an ArrayBuffer with the `input` string represented as UTF8 encoded data

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