https://github.com/anshsinghsonkhia/random-emoji-picker
Emoji utility package that allows you to fetch random emojis, get emojis by category, list available categories, and search for emojis by keyword. Perfect for adding emoji fun to your JavaScript projects!
https://github.com/anshsinghsonkhia/random-emoji-picker
npm-package
Last synced: 5 months ago
JSON representation
Emoji utility package that allows you to fetch random emojis, get emojis by category, list available categories, and search for emojis by keyword. Perfect for adding emoji fun to your JavaScript projects!
- Host: GitHub
- URL: https://github.com/anshsinghsonkhia/random-emoji-picker
- Owner: AnshSinghSonkhia
- License: apache-2.0
- Created: 2025-03-29T07:54:02.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-03-29T12:11:29.000Z (7 months ago)
- Last Synced: 2025-03-29T12:21:56.851Z (7 months ago)
- Topics: npm-package
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/random-emoji-picker
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎉 random-emoji-picker
A simple & fast emoji utility package that allows you to fetch random emojis, get emojis by category, list available categories, and search for emojis by keyword. Perfect for adding emoji fun to your JavaScript projects!
**Total number of emojis:** `1024`
[](https://www.npmjs.com/package/random-emoji-picker) [](LICENSE)
# 📦 Installation
Install via npm
```sh
npm i random-emoji-picker
```Install via yarn
```sh
yarn add random-emoji-picker
```# 🚀 Usage
```js
const rep = require('random-emoji-picker');console.log(rep.getRandomEmoji());
console.log(rep.getEmojiByCategory("animals")); // Example Output: "🐶"
console.log(rep.getEmojiByCategory("food")); // Example Output: "🍕"
console.log(rep.getEmojiByCategory("unknown")); // Example Output: nullconsole.log(rep.listCategories());
console.log(rep.getAllEmojisByCategory("food"));
// Example Output: ["🍕", "🍔", "🍎", "🍟", "🍩"]
console.log(rep.getAllEmojisByCategory("unknown"));
// Example Output: []console.log(rep.searchEmoji("cake"));
// Example Output: [ '🥞', '🧁', '🍰', '🍰', '🧁', '🍰' ]
console.log(rep.searchEmoji("unknown"));
// Example Output: []
```# 📖 API Reference
| Function | Description | Return Type | Example Usage |
|---------------------------|----------------------------------------------------------|-------------|---------------------------------------------------|
| `getRandomEmoji()` | Returns a completely random emoji from all categories. | `string` | `getRandomEmoji()` → `"😂"` |
| `getEmojiByCategory()` | Returns a random emoji from the specified category (`category`: `string`, e.g., "animals", "food"). | `string` | `getEmojiByCategory("animals")` → `"🐶"` |
| `listCategories()` | Returns an array of all available emoji categories. | `string[]` | `listCategories()` → `["happy", "sad", "animals", "food", ...]` |
| `getAllEmojisByCategory()`| Returns all emojis from the given category (`category`: `string`). | `string[]` | `getAllEmojisByCategory("food")` → `["🍕", "🍔", "🍎"]` |
| `searchEmoji()` | Searches for emojis that match a keyword (`keyword`: `string`). | `string[]` | `searchEmoji("cake")` → `["🧁", "🍰"]` |