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

janken-cli

v1.0.0

Published

A WebSocket-based janken (rock-scissors-paper) CLI game

Downloads

127

Readme

Janken CLI

WebSocket を使った対人型じゃんけん CLI です。
サーバーを立ててクライアント同士でリアルタイムに対戦できます。

Public Servers

[!Note]

npm でインストールした場合:

janken set host wss://janken-cli.oto.im
janken

リポジトリをクローンした場合:
config.jsonhost または pnpm client --host <hostname> で指定。
設定などは Client (git clone) を参照。

Node:

wss://janken-cli.oto.im

Cloudflare:

wss://janken-cli.devuloper.workers.dev

Features

  • WebSocket によるリアルタイム対戦
  • Node.jsCloudflare Workers の両方に対応
  • 表示名の設定(--name オプションまたは config ファイル)
  • テストモード(サーバー不要で CPU と対戦)
  • 任意のパスの config ファイルを指定可能

Requirements

  • Node.js v22 以上
  • pnpm v9 以上

Installation

pnpm install

Client

npx

Node.js さえあれば、リポジトリをクローンせずにそのまま遊べます。

npx janken-cli --host wss://janken-cli.oto.im --name YourName

グローバルインストールする場合:

npm install -g janken-cli
janken --host wss://janken-cli.oto.im --name YourName

セットアップ(グローバルインストール後)

--host / --name を毎回指定しなくて済むよう、set コマンドで設定を保存できます。

janken set host wss://janken-cli.oto.im
janken set name YourName

設定はOS のユーザーディレクトリに保存されるため、パッケージをアップデートしても失われません。

| OS | 保存先 | |---|---| | Windows | %APPDATA%\janken-cli\config.json | | macOS / Linux | ~/.config/janken-cli/config.json |

保存後は引数なしで起動できます。

janken

優先順位

--name / --host  >  janken set で保存した設定  >  デフォルト値

Quick Start(git clone)

pnpm client

Configuration(git clone)

config.json から設定を読み込みます。config.json.example をコピーして作成してください。

cp config.json.example config.json

config.json フィールド一覧

| フィールド | デフォルト | 説明 | |---|---|---| | name | "Anonymous" | 対戦相手に表示されるプレイヤー名 | | host | ws://localhost:3000 | 接続先サーバーの URL |

config.json 例

{
  "name": "YourName",
  "host": "ws://127.0.0.1:3000"
}

[!Note]

ドメインを割り当てている場合はそちらを使用できます。

{
  "host": "wss://example.com"
}

Options

[!Note] --config オプションは git clone でのセルフホスト向けです。
npm でインストールした場合は janken set を使用してください。

pnpm client [options]

| オプション | 説明 | デフォルト | |---|---|---| | --name <name> | 対戦相手に表示されるプレイヤー名 | config.json の name"Anonymous" | | --host <url> | 接続先サーバーの URL | config.json の hostws://localhost:3000 | | --config <path> | 使用する config ファイルのパス | config.json | | --test | テストモード(サーバー不要、CPU と対戦) | — |

優先順位

--name    >  config.json の name  >  "Anonymous"
--host    >  config.json の host  >  "ws://localhost:3000"
--config  →  指定したパスの JSON を読み込む

使用例

# 名前を指定して接続
pnpm client --name Alice

# 接続先を指定
pnpm client --host ws://example.com

# カスタム config ファイルを使用
pnpm client --config ./my-config.json

# サーバー不要のテストモード
pnpm client --test

Host (Node.js)

Quick Start

pnpm host

Configuration

config.json から設定を読み込みます。config.json.example をコピーして作成してください。

cp config.json.example config.json

config.json フィールド一覧

| フィールド | デフォルト | 説明 | |---|---|---| | port | 3000 | WebSocket サーバーのポート番号 |

config.json 例

{
  "port": 3000
}

Options

pnpm host [options]

| オプション | 説明 | デフォルト | |---|---|---| | --port <port> | リッスンするポート番号 | config.json の port3000 | | --config <path> | 使用する config ファイルのパス | config.json |

優先順位

--port    >  config.json の port  >  3000
--config  →  指定したパスの JSON を読み込む

使用例

# ポートを指定して起動
pnpm host --port 4000

# カスタム config ファイルを使用
pnpm host --config ./my-config.json

Host (Cloudflare Workers)

Quick Start

# 1. wrangler にログイン(初回のみ)
pnpm wrangler login

# 2. デプロイ
npx wrangler deploy

# 3. クライアントで接続
pnpm client --host wss://janken-cli.<your-subdomain>.workers.dev

Configuration

wrangler.jsonc でデプロイ先を設定します。

| フィールド | 説明 | |---|---| | name | Workers のプロジェクト名(サブドメインになります) | | compatibility_date | Workers の互換性日付 |

ローカル動作確認

pnpm dev:cf

Development

# テスト実行
pnpm test

# フォーマット
pnpm format

# フォーマットチェック
pnpm format:check

License

MIT