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

adb-manager

v0.0.1

Published

Cross-platform ADB connection manager

Downloads

12

Readme

ADB Manager

跨平台 ADB 连接管理器。支持 macOS / Windows / Linux。

核心功能

  • 添加、删除 ADB 连接信息(IP + 端口 + 别名)
  • 点击切换活跃设备(自动断开旧设备 → 连接新设备)
  • 实时显示连接状态
  • 配置持久化到本地 JSON 文件

预览

主界面 主界面 - 设备列表管理

添加设备 添加设备对话框

Scrcpy 支持Scrcpy屏幕镜像

架构

src/
├── core/                  ← 框架无关的核心逻辑(可复用到 TUI / Flutter)
│   ├── types.ts           共享类型定义
│   ├── adb-executor.ts    ADB 命令执行器(接口 + 实现)
│   ├── config-store.ts    配置持久化(接口 + 实现)
│   ├── device-manager.ts  设备管理业务逻辑
│   └── index.ts           对外导出
├── main/                  ← Electron 主进程
│   ├── index.ts           窗口管理 + 生命周期
│   ├── ipc-handlers.ts    IPC 桥接层
│   └── preload.ts         安全 API 注入
└── renderer/              ← React UI
    ├── App.tsx
    ├── components/
    │   ├── DeviceCard.tsx
    │   ├── AddDeviceDialog.tsx
    │   └── Toast.tsx
    ├── global.d.ts
    └── styles/globals.css

分层设计

核心层 core/ 仅依赖 Node.js 内置模块,通过接口解耦:

  • IAdbExecutor — ADB 命令执行接口,其他平台用 Go/Dart/Swift 重新实现
  • IConfigStore — 配置存储接口,其他平台可用 SharedPreferences / NSUserDefaults
  • DeviceManager — 依赖上述两个接口,包含切换/状态管理等全部业务逻辑

换 TUI 或 Flutter 时,只需:

  1. 复制 core/ 并用目标语言实现 IAdbExecutor + IConfigStore
  2. 重写 UI 层调用 DeviceManager 的公开 API

开发

npm install
npm run dev          # 同时启动 Vite + Electron(开发模式)

构建

npm run build        # 编译 TypeScript + 构建 Vite
npm run pack         # 打包为平台安装包

配置文件位置

~/.config/adb-manager/config.json