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

@jacktea/pdf-viewer-server

v0.1.19

Published

Jacktea PDF Viewer 的实时协作后端服务,基于 Socket.io 实现。

Readme

@jacktea/pdf-viewer-server

Jacktea PDF Viewer 的实时协作后端服务,基于 Socket.io 实现。

简介

如果你希望在你的 PDF 预览器中接入多人实时协作功能(如:实时看到别人的高亮、批注、评论拉取与同步),可以使用此 Node.js 服务。

服务端主要负责多端状态同步和协同数据的分发,目前作为本地运行或自行部署的独立微服务使用。

特性

  • 实时光标与轨迹:可以看到其他协作者的鼠标滚动和选择轨迹。
  • 🔄 秒级同步更新:文档中的任何批注添加与修改均会基于房间隔离实时广播。
  • 🔒 权限拦截机制:内置房间与用户身份概念的验证能力。

安装

你可以全局安装作为 CLI 服务启动:

npm install -g @jacktea/pdf-viewer-server

或者在你的自有工程中配合脚本启动:

npm install @jacktea/pdf-viewer-server

启动服务

1. 全局 CLI 方式 (开发调试)

全局安装后,在终端任意目录直接执行:

pdf-viewer-server

(默认监听 3000 端口)

2. 作为 Node 包在你的项目中启动

你可以通过 npm scripts 启动:

{
  "scripts": {
    "start:collab": "pdf-viewer-server"
  }
}

3. Server 配置环境变量

服务支持通过配置环境变量来控制行为,例如:

PORT=8080 CORS_ORIGINS="https://app.example.com" pdf-viewer-server

主要参量:

  • PORT: 启动端口 (默认 3000)
  • CORS_ORIGINS: 允许跨域请求的域名白名单,逗号分隔
  • ALLOW_ALL_ORIGINS: true (开启无限制 CORS,仅开发环境)
  • REQUIRE_AUTH: true | false (是否必须校验认证 token)