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

nabeatsu.js

v3.2.0

Published

ナベアツ判定・変換ライブラリ

Readme

nabeatsu.js

数え続ける世界のナベアツbot (@3_aho_bot) に感化されたナベアツ判定・変換ライブラリです。

npm install で判定用・変換用の関数を利用可能になり、リポジトリをクローンすることでCLIを利用できます。

./src/nabeatsu.ts に判定関数 (isNabeatsu) と変換関数 (convertIdiot) があり、./src/main.ts はローカルで動かすためのデモです。

作者の実行環境: Windows 11 + Node.js v24.16.0 (nvm-windows)

デモ動画: https://twitter.com/rin_montblank/status/2076739400122466485

Install

npm install nabeatsu.js

CommonJS / ESM のどちらからも利用できます。

import { isNabeatsu, convertIdiot } from "nabeatsu.js";

const n = 3;
const result = isNabeatsu(n); // { divisible: true, includesCount: 1 }

if (result.divisible || result.includesCount > 0) {
  console.log(await convertIdiot(n, result)); // "サァンwww!?"
}
const { isNabeatsu, convertIdiot } = require("nabeatsu.js");

API

isNabeatsu(n, options?)

数値がナベアツ的に「アホになる」対象かどうかを判定します。

| 引数 | 型 | 必須 | 説明 | | --------- | ----------------- | ---- | --------------------------------------------------------------------- | | n | number | ✅ | 判定対象の数値 | | options | NabeatsuOptions | – | 判定基準(割り切れる/含む)。省略時は { divisible: 3, includes: 3 } |

NabeatsuOptions:

| プロパティ | 型 | デフォルト | 説明 | | ----------- | -------- | ---------- | ---------------------------------------------------------------- | | divisible | number | 3 | この数値で割り切れる場合にアホになる | | includes | number | 3 | 数値の文字列表現にこの数値の文字列表現が含まれる場合にアホになる |

戻り値 Nabeatsu:

| プロパティ | 型 | 説明 | | --------------- | --------- | --------------------------------------------------------------------------- | | divisible | boolean | n % options.divisible === 0 | | includesCount | number | n.toString() 中に options.includes.toString() が出現する回数(重複含む。0 なら含まない) |

isNabeatsu(3); // { divisible: true, includesCount: 1 }
isNabeatsu(13); // { divisible: false, includesCount: 1 }
isNabeatsu(33); // { divisible: true, includesCount: 2 }
isNabeatsu(9, { divisible: 5, includes: 9 }); // { divisible: false, includesCount: 1 }

convertIdiot(n, s)

数値を「アホになったときの読み方」(カタカナ)に変換します。内部で kuroshirokuroshiro-analyzer-kuromoji を使って漢数字→カタカナ変換しているため、初回呼び出し時に辞書の読み込みが発生し多少時間がかかります(2回目以降は初期化済みのインスタンスを再利用します)。

| 引数 | 型 | 必須 | 説明 | | ---- | ---------- | ---- | --------------------------- | | n | number | ✅ | 変換対象の数値 | | s | Nabeatsu | ✅ | isNabeatsu() の結果 |

戻り値: Promise<string> — 変換後の文字列(半角カナ)

s.divisiblefalse かつ s.includesCount0 の場合は変換を行わず n.toString() をそのまま返します。どちらか一方でも条件を満たす場合のみ、以下の変換ルールが適用されます:

  1. 数値を漢数字に変換し、カタカナ読みに変換
  2. 「ュウ」→「ュー」
  3. 「サンヒャク」→「サンビャク」、「ロクヒャク」→「ロッピャク」、「ハチヒャク」→「ハッピャク」
  4. 「サンセン」→「サンゼン」、「ハチセン」→「ハッセン」
  5. 「サン」→「サァン」(文字列中のすべての「サン」が対象)
  6. 末尾に www を追加
  7. s.divisibletrue かつ s.includesCount0 より大きい場合、さらに !?s.includesCount 回繰り返して追加(例: 33includesCount: 2 なので !?!?)
  8. 半角カナに変換して返す
await convertIdiot(3, isNabeatsu(3)); // "サァンwww!?"
await convertIdiot(13, isNabeatsu(13)); // "ジューサァンwww"
await convertIdiot(33, isNabeatsu(33)); // "サァンジューサァンwww!?!?"
await convertIdiot(4, isNabeatsu(4)); // "4" (divisibleがfalseかつincludesCountが0なので変換されない)

Development

npm install
npm start          # デモを実行 (src/main.ts)
npm run build      # dist/ にライブラリをビルド (tsdown, cjs/esm)
npm run typecheck
npm run format

License

本プロジェクトは MIT License です。