all repos — emoji @ v0.0.2

A minimalistic emoji package for Go (golang)

README.md (view raw)

 1# emoji :rocket: :school_satchel: :tada:
 2[![Build Status](https://github.com/enescakir/emoji/workflows/build/badge.svg?branch=master)](https://github.com/enescakir/emoji/actions)
 3[![godoc](https://godoc.org/github.com/enescakir/emoji?status.svg)](https://godoc.org/github.com/enescakir/emoji)
 4[![Go Report Card](https://goreportcard.com/badge/github.com/enescakir/emoji)](https://goreportcard.com/report/github.com/enescakir/emoji)
 5[![Codecov](https://img.shields.io/codecov/c/github/enescakir/emoji)](https://codecov.io/gh/enescakir/emoji)
 6[![MIT License](https://img.shields.io/github/license/enescakir/emoji)](https://github.com/enescakir/emoji/blob/master/LICENSE)
 7
 8`emoji` is a minimalistic emoji library for Go. It lets you use emoji characters in strings.
 9
10Inspired by [spatie/emoji](https://github.com/spatie/emoji)
11
12## Install :floppy_disk:
13``` bash
14go get github.com/enescakir/emoji
15```
16
17## Usage :surfer:
18```go
19package main
20
21import (
22    "fmt"
23
24    "github.com/enescakir/emoji"
25)
26
27func main() {
28	fmt.Printf("Hello %v\n", emoji.WavingHand)
29	fmt.Printf("I am %v from %v\n",
30		emoji.ManTechnologist,
31		emoji.FlagForTurkey,
32	)
33	fmt.Printf("Different skin tones.\n  default: %v light: %v dark: %v\n",
34		emoji.ThumbsUp,
35		emoji.OkHand.Tone(emoji.Light),
36		emoji.CallMeHand.Tone(emoji.Dark),
37	)
38	fmt.Printf("Emojis with multiple skin tones.\n  both medium: %v light and dark: %v\n",
39		emoji.PeopleHoldingHands.Tone(emoji.Medium),
40		emoji.PeopleHoldingHands.Tone(emoji.Light, emoji.Dark),
41	)
42}
43
44/* OUTPUT
45
46    Hello πŸ‘‹
47    I am πŸ‘¨β€πŸ’» from πŸ‡ΉπŸ‡·
48    Different skin tones.
49      default: πŸ‘ light: πŸ‘ŒπŸ» dark: πŸ€™πŸΏ
50    Emojis with multiple skin tones.
51      both medium: πŸ§‘πŸ½β€πŸ€β€πŸ§‘πŸ½ light and dark: πŸ§‘πŸ»β€πŸ€β€πŸ§‘πŸΏ
52
53*/
54```
55
56This package contains Full Emoji List v13.0 based on [https://unicode.org/Public/emoji/13.0/emoji-test.txt](https://unicode.org/Public/emoji/13.0/emoji-test.txt).
57
58Also, you can generate country flag emoji with [ISO 3166 Alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes:
59```go
60emoji.CountryFlag("tr") // πŸ‡ΉπŸ‡·
61emoji.CountryFlag("US") // πŸ‡ΊπŸ‡Έ
62emoji.CountryFlag("gb") // πŸ‡¬πŸ‡§
63```
64
65All constants are generated by `internal/generator`.
66
67## Testing :hammer:
68``` bash
69go test
70```
71
72## Todo :pushpin:
73* Add emoji string replacer
74
75## Contributing :man_technologist:
76I am accepting PRs that add characters to the class.
77Please use [this list](http://unicode.org/emoji/charts/full-emoji-list.html) to look up the unicode value and the name of the character.
78
79## Credits :star:
80- [Enes Γ‡akΔ±r](https://github.com/enescakir)
81
82## License :scroll:
83The MIT License (MIT). Please see [License File](LICENSE.md) for more information.