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

hexo-font-spider

v1.0.3

Published

Hexo Console Plugin for Automatic Compression of Web Fonts

Readme

hexo-font-spider

NPM

hexo控制台插件,用于精简自定义字体文件大小,压缩后的字体文件只包含所有文章中要用到的字符。

安装

hexo-site> npm install hexo-font-spider --save

网站生成public目录之后,可以在命令行中用hexo fc自动检测并压缩字体文件

hexo-site> hexo clean
hexo-site> hexo generate
hexo-site> hexo fc

字体文件格式建议使用*.ttf

示例

在线示例:https://demo.wujiaxing.com/prowiki

说明

本插件只是对font-spider的封装、路径纠正后直接内部调用其API,一些可选参数使用的默认值,且不支持通过插件命令改变。至于命令名fc是字体压缩(font compression)的首字母。

因为自己写的主题使用的阿里巴巴的普惠体,字体文件大小接近10M,导致加载缓慢。而且不想每次生成静态网站时都手动输入font-spider命令,路径映射相当麻烦还容易出错,所以写了这个hexo插件。

关于font-spider的路径映射问题。font-spider使用的是browser-x虚拟浏览器解析文档,网站url的根路径在通过本地文件访问时,会定向到文件所在磁盘的根目录,就像用浏览器直接打开public目录中的html文件,一些css/js等文件会404,浏览器的控制台中可查看具体细节。

例如访问C:/Users/default/Desktop/index.html,其中引用的css文件会变成读取C:/style.css

如果用font-spider命令压缩,最简单的方法是把public目录复制到磁盘根目录,public目录名改为_config.yml中配置的root值,然后在磁盘根目录执行命令font-spider ./[root_val]/**/*.html

原项目几年没有更新了,如果有严重问题本人能力有限估计也解决不了,感兴趣的可以参考源码自行调整修改。

BUG

hexo server本地启动服务后,引用的*.ttf字体依然是压缩前的文件,猜测可能是主题模板中的字体文件覆盖了public目录中的字体文件。

如果部署public目录的静态网站文件应该不影响,访问的是压缩后的字体文件。

或者把./font/abc.ttf改为./font//abc.ttf能直接使用压缩后的文件,本地启动服务创建的动态网站同样生效。