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

@infinity-cli/iqiniu

v1.2.2

Published

上传七牛文件

Downloads

103

Readme

iqiniu

功能

  • 根据配置上传资源到七牛
  • 只上传新增或变更的资源
  • 上传后,刷新发生了变更的资源的 cdn 缓存
  • 上传后,清理本地不包含的资源

使用方式

  1. 安装: npm install -g @infinity-cli/iqiniu
  2. 配置: 一般项目根目录配置 infinity.config.js 或 infinity.config.json
  3. 使用说明: 查看 iqiniu -h iqiniu config -h

配置说明

参考 https://www.npmjs.com/package/@infinity-cli/shared

可配置属性

  {
    ak: Type.String(), //[选填, 默认从全局配置读取] 七牛ak
    sk: Type.String(), //[选填, 默认从全局配置读取] 七牛sk
    bucket: Type.String(), //[必填] 七牛的bucket
    from: Type.String(), //[必填] 本地相对根目录的路径
    to: Type.String(), //[必填] 七牛云端相对根目录的路径
    include: Type.Array(Type.String()), //[选填,默认为["**/*"] ] 上传操作包含的文件,glob模式匹配
    exclude: Type.Array(Type.String()), //[选填,默认为空] 上传操作排除的文件,glob模式匹配
    refreshcnd: Type.Boolean(), // [选填,默认true] 是否需要刷新cdn
    dangerous_removeNotContain: Type.Boolean(), // [选填,默认false] 是否需要移除七牛云端不被包含的文件(this.to存在,但是this.from不存在的文件);如:第一版打包有a.hash1.js,第二版为a.hash2.js, 则a.hash1.js为不被包含的文件,且不再使用,可以移除
    removeNotContainAfterDays: Type.Number(), // [选填大于等于1,默认7] 移除操作标记的delay时间
    removeNotContainExclude: Type.Array(Type.String()), //[选填,默认为空] 移除操作排除的文件,glob模式匹配
    removeNotContainInclude: Type.Array(Type.String()), //[选填,默认为["**/*"] ] 移除操作包含的文件,glob模式匹配
  }

示例 infinity.config.js

const path = require('path');
require('dotenv').config({
  path: path.join(__dirname, `.${process.env.ONLINE_ENV}.env`),
});

module.exports = {
  iqiniu: {
    ak: process.env['AK'], //[选填, 默认从全局配置读取] 七牛ak
    sk: process.env['SK'], //[选填, 默认从全局配置读取] 七牛sk
    bucket: process.env['BUCKET'], //[必填] 七牛的bucket
    from: 'dist/web', //[必填] 本地相对根目录的路径
    to: '', //[必填] 七牛云端相对根目录的路径
    dangerous_removeNotContain: true,
    removeNotContainExclude: ['amazon/**'],
  },
};

示例 infinity.config.json

{
  "iqiniu": {
    "bucket": "test-bucket",
    "from": "image",
    "to": "image"
  }
}