# utf8-length

> return the number of bytes in a unicode string

Latest version **0.0.1** (published 2013-11-29) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2013-11-29 |
| First published | 2013-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Halliday |
| Maintainers | substack |
| Keywords | utf8, utf-8, unicode, bytes, byte, array, string, encoding |

## Links

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

## 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.0.1 (latest) — 2013-11-29
- 0.0.0 — 2013-11-29

## README

# utf8-length

return the number of bytes in a unicode string

[![build status](https://secure.travis-ci.org/substack/utf8-length.png)](http://travis-ci.org/substack/utf8-length)

# example

``` js
var bytes = require('utf8-length');
console.log(bytes('¡dooq dǝǝq'));
```

result:

```
$ node example/beep.js
13
```

# methods

``` js
var bytes = require('utf8-length')
```

## bytes(string)

Return the number of bytes needed to store `string`.

# install

With [npm](https://npmjs.org) do:

```
npm install utf8-bytes
```

# license

MIT

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