# utf8-encoding

> utf8 encoder/decoder of whatwg Encoding Living Standard https://encoding.spec.whatwg.org/

Latest version **0.1.2** (published 2015-02-09) · MIT license · 0 weekly downloads

## Install

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

## 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.1.2 |
| Published | 2015-02-09 |
| First published | 2015-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jxck |
| Maintainers | jxck |
| Keywords | whatwg, w3c, encoding, encode, utf-8 |

## Links

- npm: https://www.npmjs.com/package/utf8-encoding
- Repository: https://github.com/Jxck/utf8-encoding
- Issues: https://github.com/Jxck/utf8-encoding/issues
- npm.io page: https://npm.io/package/utf8-encoding

## Dependencies (1)

- [obtain-unicode](https://npm.io/package/obtain-unicode.md) ~0.0.5

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2015-02-09
- 0.1.1 — 2015-02-09
- 0.1.0 — 2015-02-09
- 0.0.9 — 2015-02-03
- 0.0.8 — 2015-02-03
- 0.0.7 — 2015-02-02
- 0.0.4 — 2015-02-02
- 0.0.3 — 2015-01-27
- 0.0.2 — 2015-01-26
- 0.0.1 — 2015-01-26
- 0.0.0 — 2015-01-26

## README

# Isomorphic Encoding Standard implementation ignore support without UTF-8

## about

implementation of Encoding Standard `TextEncoder` & `TextDecoder`.
https://encoding.spec.whatwg.org/

but this spec includes tons of legacy encoding support you may never use.
so support only [UTF-8](https://encoding.spec.whatwg.org/#utf-8) encoding/decoding
for make script small for browser friendly :)


## install

```sh
$ npm install utf8-encoding
```

## usage

works in node and browser.
Isomorphic !! no Browserify.

```js
var encoder = new TextEncoder();
var decoder = new TextDecoder();
console.log(encoder.encode("beer!🍻"));
// Uint8Array[98, 101, 101, 114, 33, 240, 159, 141, 187]
console.log(decoder.decode(new Uint8Array([98, 101, 101, 114, 33, 240, 159, 141, 187])));
// "beer!🍻
```

## build and test

```sh
$ npm install
$ npm test
```

and also open test/index.html in your browser and see console.


## for TypeScript

use [utf8-encoding.d.ts](./utf8-encoding.d.ts)

other types which this scripts depends on are in [types](./types) directory.


## release process

- develop/maintain on master branch
- if finished, dump version to new one in package.json
- checkout release and merge master --no-ff
- build via npm test
- commit build
- add tag
- push to github
- npm publish

## License

The MIT License (MIT)
Copyright (c) 2015 Jxck

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