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

plus-sync

v1.2.0

Published

分布式P2P文件同步客户端

Readme

PeerSync - 分布式P2P文件同步客户端

测试双向同步

实时文件同步客户端,支持多客户端 P2P 同步。

安装

方式一:通过 NPM 安装

npm install -g plus-sync

方式二:下载可执行文件

从 Releases 下载对应平台的可执行文件:

  • Windows: peersync-win.exe
  • Linux: peersync-linux
  • macOS: peersync-macos

使用方法

方式一:使用配置文件(推荐)

# 生成配置文件
peersync --init-config

# 编辑 peersync.config,设置房间ID和认证信息
# 然后直接启动
peersync

方式二:命令行参数

peersync --room <room-id> --dir <sync-directory> [options]

命令行参数说明

| 参数 | 说明 | 默认值 | |------|------|--------| | --room <id> | 房间ID(必填,或从配置文件读取) | - | | --dir <path> | 本地同步目录 | ./sync | | --server <url> | 服务器地址 | wss://trae.ssh.skillup.host:8868 | | --token <token> | 认证令牌(可选,或从配置文件读取) | - | | --strategy <strategy> | 冲突解决策略: server/local/prompt | server | | --bidirectional <bool> | 双向同步开关 | true | | --watch-delay <ms> | 文件监控延迟 | 500 | | --verbose, -v | 调试模式 | false | | --init | 生成 .syncignore 文件 | - | | --init-config | 生成 peersync.config 文件 | - | | --help | 显示帮助 | - |

配置文件 peersync.config

# 基本配置
room = myproject              # 房间ID(必填)
authToken = your-token        # 认证令牌(可选)
server = wss://example.com    # 服务器地址

# 同步选项
strategy = server             # 冲突解决策略
bidirectional = true          # 双向同步
watchDelay = 500              # 监控延迟(毫秒)

# 忽略规则(逗号分隔)
ignore = node_modules/**, .git/**, *.log

使用示例

# 生成配置文件
peersync --init-config

# 生成忽略文件
peersync --init

# 使用配置文件启动(无需参数)
peersync

# 或使用命令行参数
peersync --room myproject --dir ./myproject

# 带认证令牌
peersync --room myproject --dir ./myproject --token abc123

# 本地优先冲突解决
peersync --room myproject --dir ./myproject --strategy local

功能特性

  • ✅ 实时文件同步
  • ✅ P2P 多客户端同步
  • ✅ 配置文件支持(peersync.config)
  • ✅ 认证与房间隔离
  • ✅ 增量更新
  • ✅ 全量同步
  • ✅ 冲突检测与解决
  • ✅ 自动重连
  • ✅ 文件变更节流优化
  • ✅ 并发同步队列
  • ✅ 空文件支持
  • ✅ 循环同步检测

冲突解决策略

  • server: 服务器优先(默认)
  • local: 本地优先
  • prompt: 提示用户选择

开发

# 克隆仓库
git clone <repo-url>
cd sync

# 安装依赖
npm install

# 运行测试
npm test

# 打包可执行文件
npm run build

许可证

MIT