mirror-emotion-kada
v1.0.6
Published
Mirror any emotion — get its emoji, color, quote, and sound across English, Indonesian, and Korean.
Downloads
813
Maintainers
Readme
mirror-emotion-kada
Mirror any emotion — get its emoji, color, quote, and sound across English, Indonesian, and Korean.
Install
npm install mirror-emotion-kadaQuick Start
const { getEmotionData, getEmotionFromInput } = require('mirror-emotion-kada');
// Direct lookup
const data = getEmotionData('happy');
console.log(data);
// {
// color: '#FFD600',
// emoji: '😊',
// quote: 'Happiness is a choice, not a circumstance.',
// sound: '/sounds/happy_en.mp3'
// }
// Null-safe input (trims, lowercases, handles bad input)
const result = getEmotionFromInput(' bahagia ');
console.log(result);
// {
// color: '#FFD600',
// emoji: '😊',
// quote: 'Kebahagiaan adalah pilihan, bukan keadaan.',
// sound: '/sounds/bahagia_id.mp3'
// }
// Unknown emotion returns a fallback
const unknown = getEmotionFromInput('confused');
console.log(unknown);
// { color: '#B0BEC5', emoji: '❓', quote: '...', sound: null }Supported Emotions
| English | Indonesian | Korean | Color |
|---------|------------|--------|--------|
| angry | marah | 화남 | #D32F2F |
| happy | bahagia | 행복 | #FFD600 |
| calm | tenang | 평온 | #4FC3F7 |
| sad | sedih | 슬픔 | #455A64 |
| love | cinta | 사랑 | #E91E63 |
API
getEmotionData(emotion)
Returns { color, emoji, quote, sound } for the given emotion string. Unknown emotions return a fallback object with color: '#B0BEC5', emoji: '❓', and sound: null.
getEmotionFromInput(value)
Null-safe version of getEmotionData. Trims whitespace, lowercases, and validates input. Returns null if input is not a string.
runEmotionCLI()
Launches an interactive CLI prompt to explore emotions from the terminal.
node -e "require('mirror-emotion-kada').runEmotionCLI()"Use in React / Frontend
import { getEmotionFromInput } from 'mirror-emotion-kada'
const data = getEmotionFromInput('sad')
// Use data.emoji, data.color, data.quote in your componentReturn Value
| Field | Type | Description |
|---------|----------|--------------------------------------|
| color | string | Hex color code for the emotion |
| emoji | string | Emoji representation |
| quote | string | Thoughtful quote about the emotion |
| sound | string | Path to sound file (or null) |
License
ISC
