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

@rithien/website_api

v0.1.2

Published

Clusterio plugin: public (token-gated) cluster status API for an external website — instances, online players, merged ban list

Downloads

445

Readme

@rithien/website_api

Plugin Clusterio (controller-only): publiczne — ale bramkowane statycznym tokenem — API statusu klastra dla zewnętrznej strony WWW. Strona (PHP/JS/cokolwiek) odpytuje controller i renderuje listę aktywnych serwerów (z graczami online) oraz listę banów.

Część monorepo factorio-polska; opis funkcjonalności: docs/website-api.md, workflow deploy: DEV_ENVIRONMENT.md.

Endpointy

Montowane na wbudowanym serwerze HTTP(S) controllera (ten sam port co web UI clusterio). Wszystkie wymagają nagłówka X-Website-Token: <token>; brak/zły token → 401. Pusty token w configu = API wyłączone (każde żądanie dostaje 401).

| Endpoint | Zwraca | |---|---| | GET /api/website/status | {cluster_name, generated_at, instances: [{id, name, status, game_port, public_address, game_version, started_at_ms, players: [nick, …]}]} | | GET /api/website/bans | {generated_at, total, bans: [{name, reason, source}]} |

  • status instancji: unknown / unassigned / stopped / starting / running / stopping / creating_save / exporting_data — filtruj po running po stronie strony.
  • public_address: override z comfy_adapter.public_address_overrides (nazwa hosta > wildcard *) > host.public_address; null gdy brak.
  • bans.source: clusterio (ban wymuszony w userManager clusterio) lub global_list (globalna lista deny z SQLite comfy_adapter, egzekwowana leniwie na join). Lista jest merge'em obu źródeł, dedup po nicku.

Konfiguracja

| Pole (config controllera) | Opis | |---|---| | website_api.token | Statyczny token wymagany w X-Website-Token. Wygeneruj: openssl rand -hex 32. Pusty = API wyłączone. |

npx clusterioctl controller config set website_api.token "$(openssl rand -hex 32)"

Instalacja na kontrolerze

npm install @rithien/website_api
npx clusterioctl plugin add @rithien/website_api
# restart controllera

Plugin nie ma części instance/host ani web UI — sam controller wystarczy. comfy_adapter jest opcjonalny: bez niego /bans zwraca tylko bany z userManagera clusterio.

Dev-server (lokalnie, bez klastra)

dev-server.js udaje controller z przykładowymi danymi (nie wchodzi do paczki npm):

node dev-server.js   # port 8081, token: dev-token
curl -H "X-Website-Token: dev-token" http://127.0.0.1:8081/api/website/status

Publikacja (z roota monorepo)

npm run stage:website-api                      # staging w publish/clusterio-website (strip komentarzy + parse-check)
npm run publish:website-api -- --otp=XXXXXX    # staging + npm publish