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 🙏

© 2026 – Pkg Stats / Ryan Hefner

misskey-emoji-manager

v1.1.0

Published

Create Misskey custom emoji import zip files with automatic category detection and romaji-to-hiragana alias generation

Readme

Misskey Emoji Manager

CI npm version License: MIT

Misskeyのカスタム絵文字をインポートするためのzipファイルを作成するツールです。

特徴

  • フォルダ構造からカテゴリを自動検出
  • ファイル名に基づいて絵文字名を自動生成
  • 自動正規化機能(Misskeyの絵文字命名規則に準拠)
    • ハイフンをアンダーバーに自動変換
    • スペースを自動削除
    • 無効な文字を含むファイルを自動検出してスキップ
  • オプションでローマ字からひらがなへの変換でエイリアスを生成
  • meta.jsonとzipファイルを生成

インストール

npm install -g misskey-emoji-manager

使い方

コマンドライン

misskey-emoji-manager pack <入力ディレクトリ> [出力zipファイル] [オプション]

オプション:

  • --generate-aliases: ローマ字からひらがなへの変換でエイリアスを生成します(デフォルトでは無効)

例:

# 基本的な使い方(エイリアス生成なし)
misskey-emoji-manager pack ./emojis emoji-pack.zip

# エイリアス生成を有効にする
misskey-emoji-manager pack ./emojis emoji-pack.zip --generate-aliases

ディレクトリ構造

入力ディレクトリは以下のような構造です

emojis/
├── animals/
│   ├── neko.png
│   ├── inu-san.gif
│   └── tori.png
├── food/
│   ├── ramen.png
│   └── sushi-maki.png
└── reactions/
    ├── yatta.png
    └── ganbaru-zo.png

各サブディレクトリの名前がカテゴリとして使用されます。

処理内容

  1. カテゴリ検出: サブディレクトリ名がカテゴリになります
  2. プレフィックス追加: カテゴリ名がプレフィックスとして絵文字名に追加されます
    • 例: animals/neko.pnganimals_neko
  3. 自動正規化: Misskeyの絵文字命名規則 [a-zA-Z0-9_.] に準拠するよう自動変換
    • ハイフン変換: ハイフンがアンダーバーに変換されます
      • 例: inu-san.gifanimals_inu_san
    • スペース削除: スペースが削除されます
      • 例: with space.pnganimals_withspace
    • 無効なファイル検出: 正規化後も無効な文字が含まれる場合はスキップしてコンソールに表示
      • 例: 絵文字.png[NG2] Invalid emoji name (skipped): "animals_絵文字" (original: "絵文字.png")
      • 例: [email protected] → スキップされます(@が無効な文字)
  4. エイリアス生成--generate-aliasesオプション使用時): アンダーバーで分割してローマ字からひらがなに変換
    • 例: animals_neko → エイリアス: ["animals", "ねこ"]
    • 例: animals_inu_san → エイリアス: ["animals", "いぬ", "さん", "いぬさん"]

ファイル名の取り扱い

このツールは3つのケースでファイルを処理します:

| ケース | 説明 | 例 | 結果 | |--------|------|-----|------| | OK | Misskeyの規則に最初から準拠 | normal.png | ✅ animals_normal.png | | NG1 | 補正可能(ハイフン、スペース) | with-hyphen.pngwith space.pngmy-emoji name.png | ✅ animals_with_hyphen.png✅ animals_withspace.png✅ animals_my_emojiname.png | | NG2 | 補正不可(無効な文字) | 絵文字.png[email protected]test#tag.png | ❌ スキップ(コンソールにエラー表示) |

プログラムから使用する

import {
  scanEmojiFiles,
  buildMeta,
  createEmojiZip,
  normalizeEmojiName,
  isValidEmojiName
} from 'misskey-emoji-manager';

// 絵文字ファイルをスキャン
const categoryMap = scanEmojiFiles('./emojis');

// メタデータを生成(無効なファイルは自動的にスキップされます)
// 第2引数でエイリアス生成を有効化(デフォルト: false)
const meta = buildMeta(categoryMap, false); // エイリアス生成なし
// const meta = buildMeta(categoryMap, true); // エイリアス生成あり

// zipファイルを作成
await createEmojiZip(meta, categoryMap, 'emoji-pack.zip');

// ユーティリティ関数
const normalized = normalizeEmojiName('my-emoji name'); // "my_emojiname"
const isValid = isValidEmojiName('test_emoji'); // true
const isInvalid = isValidEmojiName('test@emoji'); // false

開発

# 依存関係のインストール
npm install

# ビルド
npm run build

# 開発モード
npm run dev pack <入力ディレクトリ>

ライセンス

MIT

参考