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

koishi-plugin-disaster-warning

v0.2.2

Published

Koishi 地震、海啸与台风信息插件,支持多数据源实时推送

Readme

koishi-plugin-disaster-warning

npm

Koishi 灾害信息插件,支持中国大陆和日本地震预警、全球震后地震信息、日本海啸及台风动态推送。

本插件不是官方预警终端。接口、网络或机器人平台都可能造成延迟或漏报,请勿将其作为唯一防灾依据。

数据源

| 数据源 | 内容 | 接入方式 | 使用策略 | | --- | --- | --- | --- | | Wolfx | 中国 CENC/四川/福建/重庆 EEW、日本 JMA EEW | WebSocket | 中国默认源;延迟低 | | 中国地震预警网 Huania | 中国地震预警及连续报次 | HTTP,5 秒轮询 | 可选中国源;直接提供事件详情 | | MIUI 地震预警 | 中国地震预警记录 | 签名 HTTP,30 秒轮询 | 可选备用源;单次响应较大,不适合高频调用 | | P2P 地震情報 | 日本 JMA EEW、震后地震情报、海啸信息 | WebSocket | 日本默认与 Wolfx 同时使用,按事件报次去重 | | Wolfx CENC/JMA 列表 | 中国、日本震后测定结果 | HTTP,5 分钟轮询 | 首次启动只建立基线,不重推旧事件 | | FAN Studio FSSN | 全球震后地震信息 | WebSocket,无需 API Key | 只消费实时 update,不把初始快照当新事件 | | FAN Studio 台风 | 西北太平洋台风实况与路径 | HTTP,无需 API Key,10 分钟轮询 | 可选,默认关闭;推送新实况点 | | USGS FDSN | 全球震后地震目录 | HTTP | 仅供 ChatLuna 主动查询,不做实时群推送 |

已移除不能继续可靠使用的旧接入:FanStudio 旧 /all 多源协议与备用站、GlobalQuake,以及返回 403 的台湾 CWA/Wolfx 接口。FanStudio 当前 /fssn 和台风 GET 接口已按新版文档重新接入。

完整验证结果和取舍见 API 迁移记录。 FAN Studio 接入依据其 WebSocket 文档 与 GET API 文档;FSSN 文档注明数据仅供学术研究,使用时也应保留来源标识。

功能

  • 中国与日本实时地震预警。
  • 中国 CENC、日本 JMA 震后测定信息。
  • 日本海啸信息。
  • 全球 FSSN 震后地震信息和西北太平洋台风动态。
  • 按震级、烈度、JMA 震度过滤。
  • 按事件 ID、报次和状态去重;后续修正报仍可继续推送。
  • 按震中地名和经纬度过滤地区,台湾及其他未启用地区不会从聚合源误推送。
  • disaster.status 查看 WebSocket 与 HTTP 轮询健康状态。
  • 可选 ChatLuna 工具,主动查询 CENC、JMA、USGS 近期地震。

安装

npm install koishi-plugin-disaster-warning

也可以在 Koishi 插件市场搜索 disaster-warning。

配置

在 Koishi 控制台配置以下项目:

  1. target_groups:接收推送的群号。
  2. data_types:地震预警、震后地震信息、日本海啸信息、台风动态。台风默认关闭。
  3. regions:中国大陆、日本、全球。全球只控制 FSSN 震后信息,不代表全球实时 EEW。
  4. sources.china_warning:中国实时预警三选一。
    • wolfx:默认,WebSocket 实时推送。
    • huania:中国地震预警网,5 秒轮询。
    • miui:30 秒轮询,带宽占用较高,只建议作为备用。
  5. sources.japan_warning:both、wolfx 或 p2p。默认 both,插件会按事件与报次去重。
  6. filter:配置最低震级、烈度和震度。

中国预警源设计为单选,避免 Wolfx、Huania、MIUI 对同一地震重复推送。日本保留双源模式,是因为 P2P 还承载震后情报和海啸,且 JMA 事件 ID/报次可用于跨源去重。

升级到 0.2.0 后,旧配置中的 regions.taiwan 和 data_types.weather_alarm 已不再使用;regions.global 现在改为控制新版 FSSN 全球震后信息。请在控制台确认新增的 sources 与 data_types.typhoon_info 配置。

ChatLuna 工具

安装 koishi-plugin-chatluna 后,可设置 chatluna.enabled 注册 disaster_warning 工具。支持:

  • source: all、cenc、jma、usgs
  • location: 地点关键词
  • min_magnitude: 最低震级
  • days: 最近 1–30 天
  • limit: 最多返回条数
  • action: status: 查看数据源状态

主动查询独立于群推送地区配置,因此仍可用 USGS 查询全球地震。

命令

  • disaster.status:查看数据源状态。
  • disaster.test:生成测试预警消息。
  • disaster.history [cenc|jma] [数量]:查看最近震后测定记录。

致谢与许可

接口迁移参考 EarthQuakeWarning。本插件最初移植自 astrbot_plugin_disaster_warning。

本项目采用 AGPL-3.0 许可证。