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 🙏

© 2025 – Pkg Stats / Ryan Hefner

hexo-butterfly-clock-anzhiyu

v1.1.9

Published

A clock card plugin for theme-butterfly

Downloads

1,033

Readme

hexo-butterfly-clock

hexo-theme-butterfly添加 侧边栏电子钟

🆕 最新更新

v2.0+ 更新内容

  • ✅ 适配和风天气 v7 API
  • ✅ 替换IP定位服务(不再使用高德地图)
  • ✅ 新增可配置的API域名支持
  • ✅ 优化错误处理和数据兼容性
  • ⚠️ 废弃高德地图IP定位功能

安装

  1. 如果有安装店长的插件版侧边栏电子钟(与店长的电子钟冲突),在博客根目录[Blogroot]下打开终端,运行以下指令
  # 卸载原版电子钟
  npm uninstall hexo-butterfly-clock
  1. 安装插件,在博客根目录[Blogroot]下打开终端,运行以下指令:

     npm install hexo-butterfly-clock-anzhiyu --save
  2. 添加配置信息,以下为写法示例 在站点配置文件_config.yml或者主题配置文件_config.butterfly.yml中添加

     # electric_cloc
     electric_clock:
       enable: true # 开关
       priority: 5 #过滤器优先权
       enable_page: all # 应用页面
       exclude:
         # - /posts/
         # - /about/
       layout: # 挂载容器类型
         type: class
         name: sticky_layout
         index: 0
       loading: https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/loading.gif #加载动画自定义
       clock_css: https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/clock.min.css
       clock_js: https://cdn.cbd.int/hexo-butterfly-clock-anzhiyu/lib/clock.min.js
       qweather_key: # 和风天气key
       qweather_api_host:  # 和风天气API域名
       ip_api_key:  # 青桔IP定位API的key
       gaud_map_key: # 高得地图web服务key(已废弃,保留兼容)
       default_rectangle: false # 开启后将一直显示rectangle位置的天气,否则将获取访问者的地理位置与天气
       rectangle: 112.6534116,27.96920845 # 获取访问者位置失败时会显示该位置的天气,同时该位置为开启default_rectangle后的位置

    ⚠️ 重要提示qweather_keyip_api_key 最好自己去申请对应的 api key,默认使用示例key可能会被限制,不保证可靠性

    配置说明

    qweather_key (和风天气key)

    • 用途:获取实时天气数据
    • v7 API特点:使用 ?key=xxx 参数传递,而非 Bearer token
    • 申请地址: https://id.qweather.com/#/login
    1. 登录后进入控制台 和风天气控制台
    2. 创建应用 创建和风天气应用
    3. 填写应用名称和key名称随意
    4. 选择WebApi 选择WebApi
    5. 复制key 复制key

    ip_api_key (IP定位API的key)

    • 用途:获取访问者的IP地理位置
    • 默认服务:青桔IP定位服务 (api.nsmao.net)
    • 申请地址: 联系服务提供方
    • 返回数据格式{ code: 200, data: { city: "城市名", lng: "经度", lat: "纬度" } }

    qweather_api_host (和风天气API域名)

    • 用途:自定义和风天气API的域名
    • 默认值nj6r6pm8pt.re.qweatherapi.com
    • 使用场景:企业版或自建API服务器
    • 注意事项:确保域名支持 v7 API 且配置了正确的key

    ⚠️ 已废弃的配置

    • gaud_map_key:高德地图API(已废弃,不再使用高德地图进行IP定位)
    • ip_api:旧版IP定位接口URL(已废弃,不再使用)
  3. 参数释义

|参数|备选值/类型|释义| |:--|:--|:--| |priority|number|【可选】过滤器优先级,数值越小,执行越早,默认为10,选填| |enable|true/false|【必选】控制开关| |enable_page|path|【可选】填写想要应用的页面,如根目录就填'/',分类页面就填'/categories/'。若要应用于所有页面,就填all,默认为all| |exclude|path|【可选】填写想要屏蔽的页面,可以多个。写法见示例。原理是将屏蔽项的内容逐个放到当前路径去匹配,若当前路径包含任一屏蔽项,则不会挂载。| |layout.type|id/class|【可选】挂载容器类型,填写id或class,不填则默认为id| |layout.name|text|【必选】挂载容器名称| |layout.index|0和正整数|【可选】前提是layout.type为class,因为同一页面可能有多个class,此项用来确认究竟排在第几个顺位| |loading|URL|【可选】电子钟加载动画的图片,支持本地路径| |clock_css|URL|【可选】电子钟样式CDN资源,支持本地路径如 /lib/clock.css| |clock_js|URL|【可选】电子钟执行脚本CDN资源,支持本地路径如 /lib/clock.js| |qweather_key|string|【必选】和风天气key,用于获取天气数据| |qweather_api_host|string|【可选】和风天气API域名,默认 nj6r6pm8pt.re.qweatherapi.com| |ip_api_key|string|【可选】IP定位API的key,默认使用青桔IP定位服务| |gaud_map_key|string|【已废弃】高得地图web服务key,已废弃不再使用| |default_rectangle|true/false|【可选】是否启用固定位置,true时始终显示rectangle位置的天气| |rectangle|string|【可选】默认经纬度坐标,格式:经度,纬度|

📝 使用本地文件(可选)

如果你想要自定义样式和功能,可以将文件放到 source/lib/ 目录下:

electric_clock:
  clock_css: /lib/clock.css  # 本地CSS文件
  clock_js: /lib/clock.js   # 本地JS文件

然后自定义 source/lib/clock.jssource/lib/clock.css 文件。

📸 截图