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

ftp-relay-cli

v0.1.3

Published

CLI for uploading static assets to FTP Relay (auto CI/git headers)

Readme

ftp-relay-cli

上传静态产物到 FTP Relay 的命令行工具。
自动从 GitLab / GitHub CI 环境变量(或本地 git)填充审计 Header,无需手写一长串 curl -H

安装

npm install -g ftp-relay-cli
# 或项目内
npm install -D ftp-relay-cli
npx ftp-relay upload ./dist --url http://127.0.0.1:8080 --token tok_xxx --wait

用法

export FTP_RELAY_URL=http://127.0.0.1:8080
export FTP_RELAY_TOKEN=tok_xxxxxxxx

# 上传目录(默认打成 tgz 压缩包;自动带 X-Remote-Subdir=<目录名>,落到项目 remotePath 下)
ftp-relay upload ./202607101806 --wait
# 例:项目 remotePath=/test-ftp → 远端 /test-ftp/202607101806

# 不压缩(仅 tar)
ftp-relay upload ./dist --format tar --wait

# 已有归档(不带 X-Remote-Subdir,内容直接落到 remotePath)
ftp-relay upload ./dist.tar --wait

GitLab CI 示例

deploy:
  script:
    - npx -y -p ftp-relay-cli ftp-relay upload ./dist --wait
  variables:
    FTP_RELAY_URL: "https://ftp-relay.example.com"
    # FTP_RELAY_TOKEN 配在 CI 变量里

CI 下会自动带上:

| Header | 来源 | |--------|------| | X-Source | ci | | X-Commit | CI_COMMIT_SHA / GITHUB_SHA / git rev-parse HEAD | | X-Branch | CI_COMMIT_REF_NAME / GITHUB_REF_NAME | | X-Actor | GITLAB_USER_LOGIN / GITHUB_ACTOR / git user.name | | X-Repo | CI_PROJECT_PATH / GITHUB_REPOSITORY | | X-Pipeline-Url | CI_PIPELINE_URL / GitHub Actions run URL |

可用 --commit / --actor 等覆盖。

选项

ftp-relay upload <dir|archive>
  --url <url>         或环境变量 FTP_RELAY_URL
  --token <token>     或环境变量 FTP_RELAY_TOKEN
  --format tar|tgz    目录打包格式,默认 tgz
  --wait              同步等待结果
  --source / --commit / --branch / --actor / --repo / --pipeline-url

作为库

import { upload } from "ftp-relay-cli";

await upload({
  url: process.env.FTP_RELAY_URL!,
  token: process.env.FTP_RELAY_TOKEN!,
  path: "./dist",
  wait: true,
});