# twemoji-parser

> Parser for identifying Twemoji in text

Latest version **14.0.0** (published 2022-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install twemoji-parser
pnpm add twemoji-parser
yarn add twemoji-parser
bun add twemoji-parser
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 14.0.0 |
| Published | 2022-03-11 |
| First published | 2018-10-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/twemoji-parser) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bhaggs, n8downs, jdecked |

## Links

- npm: https://www.npmjs.com/package/twemoji-parser
- npm.io page: https://npm.io/package/twemoji-parser

## Recent versions

- 14.0.0 (latest) — 2022-03-11
- 13.1.0 — 2021-05-28
- 13.0.0 — 2020-05-09
- 12.1.3 — 2020-01-24
- 12.1.2 — 2020-01-24
- 12.1.1 — 2019-11-14
- 12.1.0 — 2019-07-01
- 12.0.0 — 2019-04-03
- 11.0.2 — 2018-10-09

## README

# Twemoji Parser [![Build Status](https://travis-ci.com/twitter/twemoji-parser.svg)](https://travis-ci.com/twitter/twemoji-parser)

A simple library for identifying emoji entities within a string in order to render them as Twemoji.

For example, this parser is used within the rendering flow for Tweets and other text on [mobile.twitter.com](https://mobile.twitter.com)

## Setup
Add `twemoji-parser` as a dependency to your project:
```
yarn add twemoji-parser
```

Or, to work directly in this repo, clone it and run `yarn install` from the repo root.

## Usage
The [tests](src/__tests__/index.test.js) are intended to serve as a more exhaustive source of documentation, but the general idea is that the parser takes a string and returns an array of the emoji entities it finds:
```js
import { parse } from 'twemoji-parser';
const entities = parse('I 🧡 Twemoji! 🥳');
/*
entities = [
  {
    url: 'https://twemoji.maxcdn.com/v/latest/svg/1f9e1.svg',
    indices: [ 2, 4 ],
    text: '🧡',
    type: 'emoji'
  },
  {
    url: 'https://twemoji.maxcdn.com/v/latest/svg/1f973.svg',
    indices: [ 12, 14 ],
    text: '🥳',
    type: 'emoji'
  }
]
*/
```
## Authors

* Nathan Downs <ndowns [at] twitter [dot] com>

Follow [@TwitterOSS](https://twitter.com/twitteross) on Twitter for updates.

## Contributing

We feel that a welcoming community is important and we ask that you follow Twitter's
[Open Source Code of Conduct](https://github.com/twitter/code-of-conduct/blob/master/code-of-conduct.md)
in all interactions with the community.

## Support

Create a [new issue](https://github.com/twitter/twemoji-parser/issues/new) on GitHub.

## Security Issues?
Please report sensitive security issues via Twitter's bug-bounty program (https://hackerone.com/twitter) rather than GitHub.

## License

MIT https://github.com/twitter/twemoji-parser/blob/master/LICENSE.md

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