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

webexter

v1.0.8

Published

A scaffolding CLI for quickly building browser extensions

Readme

webexter

基于 Vite 8 + Manifest V3 的跨平台浏览器扩展脚手架工具。

功能特性

  • 框架支持 — React 19 或 Vue 3,提供 TypeScript 和 JavaScript 两种语言选项
  • 模块化脚手架 — 按需选择页面:background、content script、popup、options、side panel、new tab page、devtools
  • 跨平台构建 — 通过 --mode 标志即可构建 Chrome、Firefox 或任意 Chromium 内核浏览器版本
  • Firefox 兼容 — 自动处理清单文件差异(browser_specific_settingssidebar_actionoptions_ui
  • 热更新支持 — 扩展页面开箱即用的热模块替换
  • WebSocket CSP — 内容安全策略已预配置,支持扩展 HMR 连接
  • webextension-polyfill — 预装跨浏览器 API 兼容层

快速开始

npx webexter create my-extension
cd my-extension
pnpm install
pnpm dev       # 开发模式 (Chrome)

然后在浏览器中加载 dist 文件夹作为未打包扩展程序。

使用方法

webexter create <项目名称>

按提示操作:

  1. 框架 — React / Vue
  2. 语言 — TypeScript / JavaScript
  3. 模块 — 多选所需页面(默认:popup + background)

可用模块

| 模块 | 描述 | Manifest Key | |---|---|---| | Background (Service Worker) | 扩展后台服务 worker | background.service_worker | | Content Script | 注入到网页的脚本 | content_scripts | | Popup | 浏览器工具栏弹出窗口 | action.default_popup | | Options Page | 扩展设置页面 | options_page | | Side Panel | 浏览器侧边栏面板 | side_panel | | New Tab Page | 新标签页 | chrome_url_overrides.newtab | | DevTools Page | DevTools 扩展面板 | devtools_page |

构建命令

| 命令 | 模式 | 输出 | |---|---|---| | pnpm dev | default | 开发模式 (Chrome) | | pnpm dev:chrome | chrome | 开发模式 (Chrome) | | pnpm dev:firefox | firefox | 开发模式 (Firefox) | | pnpm build | production | 生产构建 | | pnpm build:chrome | chrome | 生产构建 (Chrome) | | pnpm build:firefox | firefox | 生产构建 (Firefox) |

pnpm dev 启动带 HMR 的 Vite 开发服务器。在浏览器中加载 dist/ 作为未打包扩展程序。

pnpm builddist/ 中生成生产构建产物。

使用 --mode <name> 可针对任意 Chromium 内核浏览器(如 --mode qq--mode edge)。只有 firefox 模式会触发 Firefox 特定的清单转换,其他模式均使用标准 Chrome 清单格式。

生成的项目结构

my-extension/
├── package.json
├── vite.config.ts
├── manifest.json
├── tsconfig.json / jsconfig.json
├── .env
├── .env.firefox
└── src/
    ├── env.d.ts              # (仅 TypeScript)
    ├── background/
    │   └── index.ts
    ├── content/
    │   └── index.ts
    ├── popup/
    │   ├── index.html
    │   ├── main.tsx
    │   └── App.tsx
    ├── options/
    │   ├── index.html
    │   ├── main.tsx
    │   └── App.tsx
    ├── sidepanel/
    │   ├── index.html
    │   ├── main.tsx
    │   └── App.tsx
    ├── newtab/
    │   ├── index.html
    │   ├── main.tsx
    │   └── App.tsx
    ├── devtools/
    │   ├── index.html
    │   ├── devtools.ts
    │   └── devtools.js
    ├── public/
    └── ...

仅生成所选的模块。

Firefox 兼容性

使用 --mode firefox 构建时,以下清单转换会自动应用:

| 功能 | Chrome | Firefox | |---|---|---| | 插件 ID | 不需要 | browser_specific_settings.gecko.id | | 侧边栏面板 | side_panel | sidebar_action | | 选项页面 | options_page | options_ui(带 open_in_tab)|

webextension-polyfill 包提供跨浏览器 API 兼容性(在所有浏览器中使用 browser.* API)。

环境变量

| 变量 | 用途 | |---|---| | VITE_FIREFOX_ID | Firefox 插件 ID(默认:<project>@example.com)|

.env(通用)或 .env.firefox(仅 Firefox)中定义自定义变量。

License

MIT