0.2.1 • Published 5 years ago

smile-parser v0.2.1

Weekly downloads
53
License
MIT
Repository
github
Last release
5 years ago

Build Status

smile-parser

Greenkeeper badge This is a small library which takes a string, parses emojis out and replaces them with html image tags and returns the string.

Parses emojis from given string with syntax:

  • :emoji:
  • :emoji::skin-tone-2:
  • :) :/ :( :'( :| ;) :D :P :o <-- These emojis require a start or end of string or space before or after to work, this is to avoid messing up url's for example

Supports only apple emojis hosted separately. Emoji-data comes from iamcal/emoji-data repository so huge thanks for him!

Usage

  • Install and require the package
  • Define options for the smile-parser
const emojiOpts = {
  url: https://demo.url/emojis/,
  styles: "height: 21px; position: relative;"
}
  • you need to host emojis somewhere and give the url to emoji folder in options

  • Run smileParse to a string you wish to parse

smileParse(string, emojiOpts)

Commands

  • npm run test - Runs all the test
  • npm run build - Compiles the code
  • npm run compile-emoji minifies new emoji-data to include only necessary fields

Todo:

  • Support sprites
  • Create a demo page
  • Support other emoji-libraries
  • Finish this readme

License

MIT see LICENSE.md for details.

0.2.1

5 years ago

0.2.0

5 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago