Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/deptno/markdown-to-text-emoji

: smile : with text => :smile: with text
https://github.com/deptno/markdown-to-text-emoji

emoji emoji-convert markdown markdown-emoji string-emoji text-emoji text-emotions

Last synced: 27 days ago
JSON representation

: smile : with text => :smile: with text

Awesome Lists containing this project

README

        

# markdown to text emoji
[![npm](https://img.shields.io/npm/dt/markdown-to-text-emoji.svg?style=for-the-badge)](https://www.npmjs.com/package/markdown-to-text-emoji)

|Input|Output|
|---|---|
|`hello :smile: :smiling_imp::smile:`|`hello 😄 😈😄`|

> All primitive input evaluate String except `null`, `undefined`,
> `null`, `undefined` evaluate empty string.

## Install

```bash
npm install markdown-to-text-emoji
```

## Usage
```typescript
import {textEmoji} from 'markdown-to-text-emoji'

textEmoji(`hello :smile: :smiling_imp::smile:`) // `hello 😄 😈😄`
```

## Test
```bash
$ jest --coverage
PASS ./index.spec.ts
emoji
✓ emoji (4ms)
✓ createMapMdToEmoji (1ms)
✓ emojiMd
✓ createRegExpTest (1ms)
✓ textEmoji (3ms)

---------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------|----------|----------|----------|----------|-------------------|
All files | 100 | 100 | 100 | 100 | |
emoji.ts | 100 | 100 | 100 | 100 | |
markdown-to-text.ts | 100 | 100 | 100 | 100 | |
---------------------|----------|----------|----------|----------|-------------------|

=============================== Coverage summary ===============================
Statements : 100% ( 13/13 )
Branches : 100% ( 0/0 )
Functions : 100% ( 1/1 )
Lines : 100% ( 13/13 )
================================================================================
Test Suites: 1 passed, 1 total
Tests: 5 passed, 5 total
Snapshots: 0 total
Time: 3.181s
Ran all test suites.
✨ Done in 3.68s.
```

> emoji data [markdown-it-emoji](https://github.com/markdown-it/markdown-it-emoji)

## LICENSE
MIT