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

@zhgh/osskit

v1.0.15

Published

ali-oss upload tool. A command is used to upload the specified file and replace the file path

Downloads

6

Readme

OSS 文件上传工具

ali-oss 上传工具,一个命令直接上传指定文件、替换文件路径

快速使用

步骤一

创建配置文件 osskit.config.json 或者 osskit.local.json (后者的优先级更高)


{
  "oss": {
    "endpoint": "endpoint",
    "accessKeyId": "accessKeyId",
    "accessKeySecret": "accessKeySecret",
    "bucketName": "bucketName"
  },
  "list": {
    "demo": {
      "uploadDir": "/home/xxx/images",
      "replaceDir": "/home/xxx"
    }
  }
}

步骤二

  • 使用 npx , 命令行运行 npx @zhgh/osskit -c osskit.config.json -k demo
  • or
  • 本地安装 npm install -g @zhgh/osskit && osskit -c osskit.config.json -k demo

osskit 命令参数

  • -c 指定配置文件,不指定默认当前目录下的 osskit.config.json
  • -k 指定操作哪个目录,不指定则运行 list 下面的所有目录

配置文件参数

oss 相关

  • endpoint 阿里云 oss 对应的 enpoint
  • accessKeyId
  • accessKeySecret
  • bucketName
  • storageDirectory 上传到 oss 图片存储目录 (可选填, 默认值为 osskit)

mapFileName

映射文件名 —— 本地文件和它对应网络地址映射文件的文件名称

  • string 可选填
  • 默认值 __image.json

list 对象

  • uploadDir 需要上传的文件夹路径

    • string 选填,默认值为空
    • 不填默认不进行文件上传操作。
  • replaceDir 需要替换文件内容的目录路径

    • string 选填,默认为空。(如果需要替换操作,replaceDirreplaceMapFile 两个参数必须有一个必填)
    • 若不填则不进行替换文件内容操作,否则对指定目录下的文件进行本地文件地址自动修改为对应的网络地址。
  • replaceMapFile 可选,替换映射文件地址 (如果传,则优先使用,否则使用 uploadDir 下的映射地址文件 )