npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

unicode-name

v1.0.4

Published

[Unicode 16.0.0] Returns the name, aliases, or label of a Unicode character or Emoji

Downloads

4,046

Readme

unicode-name.js [ci]

Get the name of any Unicode character or Emoji in JavaScript! The purpose of this library is to return a useful name or label for any character/codepoint, even if it is special, unusual, or invalid. Also works with named characters constructed from multiple codepoints, like many Emoji characters.

Unicode version: 16.0.0 (September 2024)

Install

Use npm or your favorite package manager to install this module:

npm install unicode-name

Or use the ESM module directly in your browser.

Usage

unicodeName(char)

Returns the best name of the character or known codepoint sequence:

import { unicodeName } from "unicode-name";

// Return name of a character
unicodeName("A"); // "LATIN CAPITAL LETTER A"
unicodeName("🚡"); // "AERIAL TRAMWAY"
unicodeName("丁"); // "CJK UNIFIED IDEOGRAPH-4E01"
unicodeName("한"); // "HANGUL SYLLABLE HAN"

// Supports Unicode 16 (September 2024)
unicodeName("𜱼"); // "SQUARE SPIRAL FROM TOP LEFT"

// Can be used with integers representing codepoint values
unicodeName(48); // "DIGIT ZERO"
unicodeName(9450); // "CIRCLED DIGIT ZERO"

// Returns useful alias for control characters
unicodeName("\0"); // "NULL"
unicodeName("\t"); // "CHARACTER TABULATION"

// Applies Unicode's name corrections
unicodeName("Ƣ"); // "LATIN CAPITAL LETTER GHA", not "LATIN CAPITAL LETTER OI"

// Uses codepoint labels for special / unassigned areas of the codepoint spectrum
unicodeName("󿿿"); // "<noncharacter-FFFFF>"
unicodeName("𐱐"); // "<reserved-10C50>"
unicodeName("󿿽"); // "<private-use-FFFFD>"
unicodeName(String.fromCodePoint(55296)); // "<surrogate-D800>"

// Supports characters made from codepoint sequences
unicodeName("‼︎"); // "DOUBLE EXCLAMATION MARK (text style)"
unicodeName("㓟︀"); // "CJK COMPATIBILITY IDEOGRAPH-2F81F"
unicodeName("င︀"); // "MYANMAR LETTER NGA (dotted form)"
unicodeName("நி"); // "TAMIL SYLLABLE NI"
unicodeName("🇺🇳"); // "FLAG: UNITED NATIONS"
unicodeName("🏴󠁧󠁢󠁳󠁣󠁴󠁿"); // "SCOTLAND"
unicodeName("🧑‍🦱"); // "PERSON: CURLY HAIR"
unicodeName("👨‍🍼"); // "MAN FEEDING BABY"
unicodeName("❤️‍🔥"); // "HEART ON FIRE"
unicodeName("🫱🏻‍🫲🏾"); // "HANDSHAKE: LIGHT SKIN TONE, MEDIUM-DARK SKIN TONE"
unicodeName("🐦‍⬛"); // "BLACK BIRD"
unicodeName("🙂‍↔️"); // "HEAD SHAKING HORIZONTALLY"
unicodeName("‘︁"); // "LEFT SINGLE QUOTATION MARK (right-justified fullwidth form)"

Please note: Supports single characters the Unicode standard recognizes (which can be composed out of one ore more codpoints). The return value for string with more than one character is always undefined.

unicode […] Name(char) Functions

Additional, more specfic name functions (e.g. getting aliases for a codepoint) are available too, see DOCS or SPECS for more info.

Also see

  • https://character.construction/name/ - "Name That Character" implemented using this library
  • https://github.com/janlelis/uniscribe/ - CLI utility that displays names of codepoints and more
  • https://github.com/janlelis/unicoder/ - Creates the indexes this library is based on

MIT License

  • Copyright (c) 2024 Jan Lelis https://janlelis.com. Released under the MIT license.
  • Unicode data: https://www.unicode.org/copyright.html#Exhibit1