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

@iiko/frm

v0.1.0

Published

Flutter Repository Mirror — 一行命令切换 Flutter pub / SDK 镜像源

Downloads

8

Readme

frm — Flutter Repository Mirror

npm version node license

一行命令切换 Flutter pub / SDK 镜像源。跨平台(Windows / macOS / Linux),零运行时依赖(仅 Node ≥ 14)。

安装

# 全局安装(推荐)
npm install -g @iiko/frm

# 或不安装直接试用
npx @iiko/frm ls

包名是 scoped 的 @iiko/frm,但安装后可执行文件仍叫 frm

升级:

npm update -g @iiko/frm

从源码运行(开发用):

git clone https://github.com/ikonan/frm.git
cd frm
node bin/frm.js <command>

用法速览

frm ls                  # 列出全部镜像源,并标注当前生效项
frm current             # 显示当前 PUB_HOSTED_URL / FLUTTER_STORAGE_BASE_URL
frm use tencent         # 切换到腾讯云源(持久化到用户级环境变量)
frm test                # 真实端点测速(pub: /api/packages/path;sdk: releases_<os>.json)
frm reset               # 清除两个环境变量,恢复 Flutter 默认行为
frm add <n> <p> <s>     # 新增自定义镜像源
frm rm <name>           # 删除自定义镜像源
frm env tencent         # 打印 export 命令(可 eval / iex 当前会话立即生效)

内置镜像源

| name | pub | storage | | ---------- | ------------------------------------------ | ---------------------------------------------- | | official | https://pub.dev | https://storage.googleapis.com | | tuna | https://pub.flutter-io.cn | https://storage.flutter-io.cn | | tencent | https://mirrors.cloud.tencent.com/dart-pub | https://mirrors.cloud.tencent.com/flutter | | sjtug | https://dart-pub.mirrors.sjtug.sjtu.edu.cn | https://mirrors.sjtug.sjtu.edu.cn/flutter |

tuna 即清华源的 flutter-io.cn。该域名由清华大学托管但官方已不再主动维护,可作备用。 sjtug 偶有 TLS / 同步延迟问题,先用 frm test 验证再切换。

持久化机制

  • Windows:通过 PowerShell 调用 [Environment]::SetEnvironmentVariable(..., 'User') 写入注册表 HKCU\Environment。新开 PowerShell / cmd / IDE 终端自动生效。
  • macOS / Linux:在 ~/.zshrc~/.bashrc(按 $SHELL 选择)中维护一个用 # >>> frm-managed ... <<< 包裹的代码块,source 或重开终端生效。

任意时刻可以用 frm reset 一键清除。

当前会话立即生效

由于环境变量改动不影响已开终端,需要立即生效时:

# PowerShell
frm env tencent | iex
# Bash / Zsh
eval "$(frm env tencent)"

或使用 frm use tencent --session,它仅打印命令而不持久化。

自定义镜像源

frm add myco https://pub.example.com https://storage.example.com "Internal Mirror"
frm use myco
frm rm myco

自定义源存放在 ~/.frm/config.json

测速逻辑

frm test 对每个源并发发起两个 GET 请求:

  • pub:<pub>/api/packages/path — 体积极小、所有正经镜像都会代理的官方包
  • storage:<storage>/flutter_infra_release/releases/releases_<os>.json — Flutter 自己拉版本信息时打的真实路径

只有 2xx 才算可用,自动跟随 301/302。这意味着结果反映的是镜像对 Flutter 的真实可用性,而不是单纯的 host 可达性。

相关链接

  • npm:https://www.npmjs.com/package/@iiko/frm
  • 源码 / Issues:https://github.com/ikonan/frm

License

MIT