$ show Momo707577045/iconfont-preview
This repository is a specialized tool for previewing icon fonts, primarily targeting frontend developers. It consists of three main components: a Node.js HTTP server (font-searcher.js) that scans local directories for font files and provides a REST API, a single-page Vue.js application (index.html) that loads and displays icons from local or online sources, and a browser userscript (iconfont-preview.user.js) that enhances web pages by detecting iconfont links and offering quick previews. The tool supports multiple font formats (TTF, WOFF, WOFF2, OTF, EOT) and uses opentype.js for TTF/OTF parsing and a WebAssembly module (woff2-decode.js) for WOFF2 decoding. For online CSS/JS resources, it extracts icon names via regex. The architecture combines a local server for development scanning with a client-side Vue app for rendering, while the userscript enables on-the-fly previewing during web browsing.
The LLM identified 1 files worth highlighting for reuse:
A self-contained Node.js script that creates an HTTP server to serve font files from a directory and provides a simple REST API to list fonts and fetch font files. It demonstrates skill in handling binary file responses, CORS, and URL routing without external dependencies, making it reusable for any project needing to serve static files with a minimal API.