# @cto.af/textdecoder

> Quick wrapper that finds TextDecoder in your runtime, or uses an adequate polyfill

Latest version **0.3.0** (published 2026-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cto.af/textdecoder
pnpm add @cto.af/textdecoder
yarn add @cto.af/textdecoder
bun add @cto.af/textdecoder
```

## Health

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

Positive: has types; no vulnerabilities; has provenance; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2026-03-03 |
| First published | 2021-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=5.10.0 |
| Dependencies | 0 |
| Unpacked size | 10.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Joe Hildebrand |
| Maintainers | hildjj |
| Keywords | TextDecoder, utf8, utf-8, polyfill |

## Links

- npm: https://www.npmjs.com/package/@cto.af/textdecoder
- Repository: https://github.com/hildjj/ctoaf-textdecoder
- Homepage: https://github.com/hildjj/ctoaf-textdecoder#readme
- Issues: https://github.com/hildjj/ctoaf-textdecoder/issues
- npm.io page: https://npm.io/package/@cto.af/textdecoder

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M 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
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2026-03-03
- 0.2.4 — 2025-09-16
- 0.2.2 — 2025-08-05
- 0.2.1 — 2025-06-21
- 0.2.0 — 2022-06-18
- 0.1.0 — 2021-11-13
- 0.0.1 — 2021-11-09
- 0.0.0 — 2021-02-27

## README

# Simple TextDecoder polyfill

I needed this in two different projects, so I pulled it out.  All of the
existing TextDecoder polyfills try to do too much for what I needed.  The goal
here is to NOT require any Unicode tables, keeping this as small as possible.

This just finds the best TextDecoder instance it can, and mocks in an adequate
one for old or broken environments.

## Use

```js
const TextDecoder = require('@cto.af/textdecoder')
```

## API

See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder)

[![Tests](https://github.com/hildjj/ctoaf-textdecoder/actions/workflows/node.js.yml/badge.svg)](https://github.com/hildjj/ctoaf-textdecoder/actions/workflows/node.js.yml)
[![codecov](https://codecov.io/gh/hildjj/ctoaf-textdecoder/graph/badge.svg?token=JRWVG7UFKQ)](https://codecov.io/gh/hildjj/ctoaf-textdecoder)

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