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

kbapp-oss

v0.0.5

Published

Upload local files to Aliyun OSS with local credential storage

Readme

kbapp-oss

kbapp-oss 只负责把本地目录上传到阿里云 OSS。 构建命令请放在业务项目自己的 package.json scripts 里。

安装

npm install kbapp-oss -g

第一次使用

kbapp-oss config set accessKeyId 由刘旭提供
kbapp-oss config set accessKeySecret 由刘旭提供

默认本地存储路径:

~/.kbapp-oss/credentials.json

项目配置

项目根目录放置 kbapp-oss.config.js

module.exports = {
  envs: [
    {
      name: "dev1",
      region: "oss-cn-hangzhou",
      bucket: "web-page-dev-1",
      uploadDir: "dist",
      targetDir: "my-app/dev1",
      authorizationV4: true,
      website: "https://dev1.your-domain.com",
      onUploadSuccess(config) {
        console.log("访问: 打开 https://your-domain.com 查看效果");
      },
    },
  ],
};

字段说明:

  • envs[].name/region/bucket/uploadDir: 必填
  • envs[].targetDir: OSS 目标目录前缀,默认根目录
  • envs[].authorizationV4: 是否启用 V4 鉴权,默认 true
  • envs[].website: 可选 上传成功后额外打印访问链接
  • envs[].onUploadSuccess(config): 上传成功后执行当前环境回调,参数为当前配置对象

上传(读取配置文件)

交互选择环境:

npx kbapp-oss upload

指定环境:

npx kbapp-oss upload --env dev1

直接上传(不读取配置文件)

npx kbapp-oss put \
  --bucket web-page-dev-1 \
  --region oss-cn-hangzhou \
  --uploadDir dist \
  --targetDir my-app/dev1 \
  --authorizationV4 true \
  --website https://dev1.your-domain.com

说明:

  • put 必填: --bucket--region--uploadDir
  • put 选填: --targetDir(默认根目录)、--authorizationV4(默认 true)、--website
  • 上传前会提示确认 bucket/targetDir,确认后才执行
  • 上传成功后,若传入 website 会打印访问链接

CLI 命令

kbapp-oss config set <accessKeyId|accessKeySecret> [value] [--from-stdin]
kbapp-oss config get <accessKeyId|accessKeySecret> [--raw]
kbapp-oss config unset <accessKeyId|accessKeySecret>
kbapp-oss config list
kbapp-oss upload [--env <name>]
kbapp-oss put --bucket <bucket> --region <region> --uploadDir <dir> [--targetDir <dir>] [--authorizationV4 <true|false>] [--website <url>]

查看帮助:

npx kbapp-oss --help
npx kbapp-oss config --help
npx kbapp-oss upload --help
npx kbapp-oss put --help

和编译相关命令结合

可以在package.json中

{
  "scripts": {
    "upload:test": "npm run build && kbapp-oss upload --env 测试环境",
  },
}