all repos — emoji @ 964e968b04d2cf923dfcc03fb40f7da1cad5bd68

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![MIT License](https://img.shields.io/github/license/enescakir/emoji)
 6
 7`emoji` is a minimalistic emoji library for Go. It lets you use emoji characters in strings.
 8
 9Inspired by [spatie/emoji](https://github.com/spatie/emoji)
10
11## Install :floppy_disk:
12``` bash
13go get github.com/enescakir/emoji
14```
15
16## Usage :surfer:
17```go
18package main
19
20import (
21    "fmt"
22
23    "github.com/enescakir/emoji"
24)
25
26func main() {
27    fmt.Printf("hello %v from %v\n", 
28        emoji.WavingHand, 
29        emoji.FlagsForFlagTurkey,
30    )
31    fmt.Printf("different skin tones. default: %v light: %v dark: %v\n", 
32        emoji.ThumbsUp,
33        emoji.OkHand.Tone(emoji.Light),
34        emoji.CallMeHand.Tone(emoji.Dark),
35    )
36    fmt.Printf("emoji with multiple skins: %v\n", 
37        emoji.PeopleHoldingHands.Tone(emoji.Light, emoji.Dark),
38    )
39}
40
41/* OUTPUT
42
43    hello 👋 from 🇹🇷
44    different skin tones. default: 👍 light: 👌🏻 dark: 🤙🏿
45    emoji with multiple skins: 🧑🏻‍🤝‍🧑🏿
46
47*/
48```
49
50This 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).
51
52Also, you can generate country flag emoji with [ISO 3166 Alpha2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes:
53```go
54emoji.CountryFlag("tr") // 🇹🇷
55```
56
57## Testing :hammer:
58``` bash
59go test
60```
61
62## Todo :pushpin:
63* Add `godoc`
64* Add badges to README
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.