-
-
Notifications
You must be signed in to change notification settings - Fork 246
Description
Forking @bigpay-ali's #132 (comment):
Hello beautiful humans, I love what you did with this lib and thank you for providing this library for developer like me to build on top of it, is there a way we can get this fix merged? I desprately need some emojis which are missing from your lib. Maybe we can add a
.extend(":emoji-code","✅")function, just in case some emojis are missing, developer can update it and make it searchable across project?
I like this idea. Even after the latest emojilib gets merged in, it's possible folks will want to add their own context/project-specific emoji extensions.
One difficulty with this is that right now, all node-emoji APIs are exported standalone: e.g. import { findByName } from "node-emoji". This new extension API would need to either:
- Modify the global-ish data used by the entire
node-emojimodule - Create and return a new object with APIs
I'd lean towards the latter personally, as modifying global state is a worrisome thing to me.
My starting API proposal:
import { extend } from "node-emoji";
const emojiBank = extend({
emojis: [
{ code: "yeehaw", emoji: "🤠" }
]
});This differs from the original comment by being more explicit and open to later expansion, at the cost of extra verbosity.