# charcount

> Count visual length of javascript string.

Latest version **1.0.0** (published 2016-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install charcount
pnpm add charcount
yarn add charcount
bun add charcount
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-03-03 |
| First published | 2016-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | vitaly |
| Keywords | string, length |

## Links

- npm: https://www.npmjs.com/package/charcount
- Repository: https://github.com/nodeca/charcount
- Homepage: https://github.com/nodeca/charcount#readme
- Issues: https://github.com/nodeca/charcount/issues
- npm.io page: https://npm.io/package/charcount

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-03-03

## README

charcount
=========

[![Build Status](https://travis-ci.org/nodeca/charcount.svg?branch=master)](https://travis-ci.org/nodeca/charcount)
[![NPM version](https://img.shields.io/npm/v/charcount.svg)](https://www.npmjs.org/package/charcount)

> Count visual length of javascript string.

Some symbols in JavaScript can occupy 2 characters (surrogate pair).
This package count string length as you see it in browser:

```js
var charcount = require('charcount');

console.log(charcount('😀')); // => 1
console.log('😀'.length);     // => 2
```


Related projects
----------------

If you works with strings for terminal output, you may wish to ignore
ASCII escape sequences. See those projects then:

- [string-length](https://github.com/sindresorhus/string-length)
- [string-width](https://github.com/sindresorhus/string-width)


License
-------

[MIT](https://github.com/nodeca/charcount/blob/master/LICENSE)

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