Skip to main content
Home

Built and signed on GitHub Actions

🦕 GitHub emoji library for TypeScript

This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
This package works with Deno
It is unknown whether this package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 years ago (1.0.0)

github-emoji

jsr denoland deno doc Test

GitHub emoji library for TypeScript.

Usage

Get a emoji string of a name (e.g. smile), use emojiOf function like:

import { emojiOf } from "https://deno.land/x/github_emoji@$MODULE_VERSION/mod.ts";

console.log(emojiOf("smile"));
// -> ☺️

The emojiOf require EmojiName instead of string so invalid emoji name become TypeScript error.

import {
  EmojiName,
  emojiOf,
} from "https://deno.land/x/github_emoji@$MODULE_VERSION/mod.ts";

console.log(emojiOf("smile")); // OK
//console.log(emojiOf("this-is-not-valid-emoji-name")); // TypeScript error
console.log(emojiOf("this-is-not-valid-emoji-name" as EmojiName)); // OK but returns undefined

Replace all valid :{name}: like strings (e.g. :smile:) in a text with emoji strings, use emojify function like:

import { emojify } from "https://deno.land/x/github_emoji@$MODULE_VERSION/mod.ts";

console.log(emojify("Hello :world: :smile:")); // :world: is not valid emoji
// -> Hello :world: ☺️

See API documentation for more details and functions.

License

The code follows MIT license written in LICENSE. Contributors need to agree that any modifications sent in this repository follow the license.

Special Thanks

This library is strongly inspired by rhysd/node-github-emoji.

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@lambdalisue/github-emoji

Import symbol

import * as github_emoji from "@lambdalisue/github-emoji";
or

Import directly with a jsr specifier

import * as github_emoji from "jsr:@lambdalisue/github-emoji";

Add Package

pnpm i jsr:@lambdalisue/github-emoji
or (using pnpm 10.8 or older)
pnpm dlx jsr add @lambdalisue/github-emoji

Import symbol

import * as github_emoji from "@lambdalisue/github-emoji";

Add Package

yarn add jsr:@lambdalisue/github-emoji
or (using Yarn 4.8 or older)
yarn dlx jsr add @lambdalisue/github-emoji

Import symbol

import * as github_emoji from "@lambdalisue/github-emoji";

Add Package

vlt install jsr:@lambdalisue/github-emoji

Import symbol

import * as github_emoji from "@lambdalisue/github-emoji";

Add Package

npx jsr add @lambdalisue/github-emoji

Import symbol

import * as github_emoji from "@lambdalisue/github-emoji";

Add Package

bunx jsr add @lambdalisue/github-emoji

Import symbol

import * as github_emoji from "@lambdalisue/github-emoji";