Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Nov 9, 2017
1 parent 7ecbd7c commit e0589b8
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
44 changes: 38 additions & 6 deletions README.md
Expand Up @@ -19,9 +19,32 @@ $ npm i --save github-api-emojis


```js
// Usage:
//// Map
const emojisMap = require("../lib/map")

if (emojisMap["tada"]) {
console.log("Yay, 'tada' exists!")
// => Yay, 'tada' exists!
}

//// List
const emojisList = require("../lib/list")

console.log(emojisList.filter(c => c.startsWith("heart")))
// =>
// [ 'heart',
// 'heart_decoration',
// 'heart_eyes',
// 'heart_eyes_cat',
// 'heartbeat',
// 'heartpulse',
// 'hearts' ]

// Or simply require the lib if you need to use both
const GitHubApiEmojis = require("github-api-emojis");

console.log(GitHubApiEmojis);
console.log(GitHubApiEmojis.list);
// =>
// [ '100',
// '1234',
Expand All @@ -30,11 +53,20 @@ console.log(GitHubApiEmojis);
// 'baseball',
// ... 1408 more items ]

console.log(GitHubApiEmojis.includes("tada"));
// => true

console.log(GitHubApiEmojis.includes("foo"));
// => false
console.log(GitHubApiEmojis.map);
// =>
// { '100': 1,
// '1234': 1,
// '+1': 1,
// '-1': 1,
// '1st_place_medal': 1,
// '2nd_place_medal': 1,
// '3rd_place_medal': 1,
// '8ball': 1,
// a: 1,
// ...
// zipper_mouth_face: 1,
// zzz: 1 }
```


Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -48,4 +48,4 @@
"devDependencies": {
"gh.js": "^3.0.11"
}
}
}

0 comments on commit e0589b8

Please sign in to comment.