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

huaweicloud-nodejs-obs-plugin

v1.2.0

Published

Local batch upload of HUAWEI CLOUD plug-ins

Downloads

118

Readme

huaweicloud-nodejs-obs-plugin

本地批量上传华为云插件

NPM version npm download

插件说明

该插件会自动上传指定目录的文件到obs指定位置,同时对已上传的文件进行删除,并备份到本地的指定目录。如有重名文件,则跳过,并在控制条给出文件重复的提示

使用说明

  1. npm i -D huaweicloud-nodejs-obs-plugin
  2. 在项目根目录添加配置文件obs-config.js
  3. 在项目根目录执行
    1. uploadImages 用于上传小程序图片资源,会检测备份目录是否存在相同文件,然后自动移动目标文件夹的图片到备份目录
    2. uploadFont 自动解压zip压缩包并上传字体资源
    3. uploadFiles 上传文件夹下的所有文件夹,覆盖上传,不会移动目标文件

配置文档

// obs-config.js
module.exports = {
  OBS_AK: '', // OBS Access Key ID
  OBS_SK: '', // OBS Secret Access Key
  BUCKET_NAME: 'myStore', // 桶名称
  OBJECT_NAME: 'wesite/demo/', // OBS对象的前置文件夹,一般指项目目录
  // uploadImages 相关
  IMAGES_OBS_FOLDER: 'images/', // 远程项目目录的images资源文件夹
  IMAGES_PATH: '/src/static/images', // 本地原有资源目录
  IMAGES_BACKUP_PATH: '/bak.images', // 本地备份资源目录
  IMAGES_IGNORE: ['.DS_Store'], // 忽略上传名单
  // uploadFiles
  FILES_OBS_FOLDER: 'static/', // 远程项目目录的资源文件夹
  FILES_PATH: '/src/static/files_folder', // 本地原有资源目录
  FILES_IGNORE: [], // 忽略上传名单
  // uploadFont
  ICONFONT_OBS_FOLDER: 'iconfont/', // 远程项目目录的iconfont文件夹
  ICONFONT_FILE_PATH: '/src/styles/iconfont.css', // 本地iconfont.css文件位置,用于更新font-face
  ICONFONT_IGNORE: ['demo_index.html', 'demo.css'], // iconfont 上传忽略名单
  // 要替换的font-face的内容
  TEMPLATE_FONT_FACE: 
          '@font-face {\n' +
          '  font-family: "iconfont";\n' +
          '  src: url(\'https://your.obs-cdn.com/wesite/demo/iconfont/iconfont.woff2\') format(\'woff2\'),\n' +
          '    url(\'https://your.obs-cdn.com/wesite/demo/iconfont/iconfont.woff\') format(\'woff\'),\n' +
          '    url(\'https://your.obs-cdn.com/wesite/demo/iconfont/iconfont.ttf\') format(\'truetype\'),\n' +
          '    url(\'https://your.obs-cdn.com/wesite/demo/iconfont/iconfont.svg\') format(\'svg\');\n' +
          '}',

};

Tips

  1. 上传前需要注意是否真实存在于obs中,否则会报错
  2. iconfont默认是iconfont,上传路径是下载的压缩包绝对路径

使用效果

上传图片

image-20230301114315359

上传文件

WX20230408-113728

上传iconfont

WechatIMG93