all repos — emoji @ fabeac4f28bf5e9da0c1253c6e3dac95e3d51541

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 from %v\n", 
29        emoji.WavingHand, 
30        emoji.FlagsForFlagTurkey,
31    )
32    fmt.Printf("different skin tones. default: %v light: %v dark: %v\n", 
33        emoji.ThumbsUp,
34        emoji.OkHand.Tone(emoji.Light),
35        emoji.CallMeHand.Tone(emoji.Dark),
36    )
37    fmt.Printf("emoji with multiple skins: %v\n", 
38        emoji.PeopleHoldingHands.Tone(emoji.Light, emoji.Dark),
39    )
40}
41
42/* OUTPUT
43
44    hello 👋 from 🇹🇷
45    different skin tones. default: 👍 light: 👌🏻 dark: 🤙🏿
46    emoji with multiple skins: 🧑🏻‍🤝‍🧑🏿
47
48*/
49```
50
51This package contains Full Emoji List v12.0 based on [https://unicode.org/Public/emoji/12.0/emoji-test.txt](https://unicode.org/Public/emoji/12.0/emoji-test.txt).
52
53Also, you can generate country flag emoji with [ISO 3166 Alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes:
54```go
55emoji.CountryFlag("tr") // 🇹🇷
56```
57
58## Testing :hammer:
59``` bash
60go test
61```
62
63## Todo :pushpin:
64* Add `godoc`
65* Add benchmarks
66* Add emoji constant generator
67
68## Contributing :man_technologist:
69I am accepting PRs that add characters to the class.
70Please use [this list](http://unicode.org/emoji/charts/full-emoji-list.html) to look up the unicode value and the name of the character.
71
72## Credits :star:
73- [Enes Çakır](https://github.com/enescakir)
74
75## License :scroll:
76The MIT License (MIT). Please see [License File](LICENSE.md) for more information.