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 🙏

© 2024 – Pkg Stats / Ryan Hefner

swift-share

v3.0.0

Published

轻量级文本、文件传输工具。简单、快捷、一目了然。

Downloads

49

Readme

快传

简单、快捷、一目了然

npm npm npm GitHub

🔥 功能

✨ 亮点

🔀 边传边下

开始上传即可立即下载,传了多少就能下载多少。

  • 可根据实际网络情况,在配置中自定义文件分片大小,优化传输体验。

🛜 快捷传输

方法1:粘贴上传

使用粘贴快捷键一键上传剪贴板中的文本或图片。

  • 受安全策略限制,非文本和图片类型的剪贴板内容无法上传。

方法2:系统分享

将快传安装为 PWA 应用,通过系统分享上传文本和文件。

  • 目前该方法支持搭载 Android 和 Windows 系统的设备。
  • 安卓设备请使用 Chrome 浏览器,并确保 Google Play 商店在安装 PWA 应用时可用且网络环境支持访问谷歌服务。
  • 华为(鸿蒙,NEXT除外)设备安装原生 GMS 后亦可使用。
  • Windows 设备建议使用 Edge 浏览器,Chrome 可能尚未实现该功能。
  • 如果网站未使用 HTTPS 协议或设备未达到安装要求,则只会创建快捷方式,不支持系统分享。

方法3:搜索栏提取

在浏览器的搜索栏中输入提取码,即可快速查找并下载文件。

▶️ 在线播放

支持使用提取码直接在线播放媒体文件,无需下载。

  • 支持读取视频文件中的软字幕。注意,这会消耗您更多的流量。
  • 该功能支持边下边播。文件未上传完成前,媒体文件需支持流媒体才能正常播放。
  • 非边下边播状态下,非流媒体文件也能正常播放。

💼 持久共享

支持设置一个常驻的共享目录,只需将文件放入该目录,即可通过快传传输。

  • 如果共享目录所指向的路径不存在,则不会生成提取码。

🌠 夜间模式

当系统处于夜间模式时,快传也会自动切换到夜间模式。

⚙️ 灵活配置

支持自定义端口、提取码长度、过期时间等多项配置。

👀 使用方法

安装

npm install -g swift-share

启动

swift-share

停止

^C (Ctrl + C)

卸载

npm uninstall -g swift-share

反向代理

可使用 Nginx 等反向代理 Web 服务器将快传部署到子目录。

请根据下面的配置示例进行配置,错误的配置可能导致快传部分功能失效。

Nginx

nginx.conf 的 http 块中追加以下配置,使得 HTTP 协议可被升级为 WebSocket 协议。

# /etc/nginx/nginx.conf

http {
    ...

    # WebSocket
    map $http_upgrade $connection_upgrade {
        default upgrade;
        '' close;
    }
}

sites-available 目录下的配置文件中添加以下配置,将快传部署到 /swift 子路径。

  • 必须包含 host 标头。格式为 example.com:3000
  • 当使用 HTTPS 协议时,必须包含 X-Forwarded-Proto 标头。格式为 httphttps
  • 当部署在子路径时,必须包含 X-Forwarded-Path 标头,格式为 /example
  • 当部署在根目录时,X-Forwarded-Path 标头必须移除或置空。
# /etc/nginx/sites-available/default

server {
    listen 80; # IPv4 端口
    listen [::]:80; # IPv6 端口

    # 使用 HTTP/2 协议(可选)
    # http2 on; 
    
    client_max_body_size 100M; # 提升上传文件大小限制
    
    location /swift {
        proxy_pass http://localhost:3000/; # 本地端口
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Path /swift; # 子目录
    }

    location /swift/ {
        proxy_pass http://localhost:3000/; # 本地端口
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Path /swift; # 子目录

        # WebSocket
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "$connection_upgrade";
    }
}

配置

编辑配置

swift-share config edit

重置配置

swift-share config reset

清除所有数据

在数据目录外的共享目录不会被清除。

swift-share clear

♾️ Biu~ 命令

快传没有独立的管理页面,仅支持简易的命令。

如何使用?

右键单击或手指长按(触发 contextmenu 事件)主页中的网站图标,即可打开伪装的命令窗口。

执行结果

  • 如果命令匹配成功,则提示 已收到您的反馈,但是我们不会处理。 ,否则提示 已收到您的反馈,我们将尽快处理。
  • 命令的执行结果将以 console.log 的形式输出到日志。

命令列表

可在配置文件中自定义命令名称。设置为 null 时,表示禁用该命令。

| 命令 | 默认名称 | 说明 | |----------------|-----------------|---------| | GetAllCode | /getallcode | 获取所有提取码 | | ClearAllCode | /clearallcode | 清除所有提取码 | | OpenConsole | /openconsole | 启用虚拟控制台 |

⚠️ 注意事项

  • 快传未设计任何保护机制,不建议在公网环境下部署使用。
  • 关闭快传后,已上传的文件将自动删除,共享文件夹中的文件不受影响。
  • 如果发生异常退出,在下次启动时会自动清理未删除的文件。