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

cmdup

v1.0.2

Published

upload file or dir to cloud

Downloads

14

Readme

CmdUp

超方便的命令行上传工具

介绍

CmdUp的目标是简单、高效的通过命令行一键将符合规则的文件/夹按照某种指定的命名规则上传到阿里云OSS、七牛等云存储

如何使用?

安装

通过npm安装:

npm i cmdup -g

使用

cmdup会安装 up 和 upload 两个命令,使用方法是相同的:

up -f test.txt -u
// 将test.txt文件上传

命令行参数

| 参数 | 释义 | | --- | --- | | -c / --config | 指定配置文件路径 | | -f / --file | 指定上传的文件匹配规则或路径 | | -t / --type | 使用type类型上传,type包含 qiniu、aliyun 等 | | -u / --upload | 立即上传 |

配置文件

cmdup的云存储配置和上传规则都依赖于 upload.conf.json配置文件 ,在执行命令时会依次遍历 执行命令的文件夹用户根目录 搜索此文件,距离最近的优先级最高。

配置项

{
  "defaultType": "qiniu",       // 默认上传类型(等同于 -t 参数),会根据此类型从cloud中获取配置
  "files": ["dist/main.js"],    // 上传文件列表(等同于 -f 参数)
  "cloud": {                    // 云存储配置
    "qiniu": {                    // 云存储类型
      "accessKey": "**********",  // 对应平台accessKey
      "secretKey": "**********",  // 对应平台secretKey
      "bucket": "test"            // 对应平台空间 bucket
    }
  },
  "fileAutoName": "$date(yyyyMMddhhmmss)_$random_$index.$ext" // 上传文件自动命名规则,其中 魔法变量规则 详见下方
}

自动命名魔法变量

时间 $date(format)

format 代表时间格式化参数,可以由下列参数拼接:

| 参数 | 释义 | | :---: | --- | | yyyy | 四位年份,如2019 | | yy | 两位年份,如 19 | | MM | 补零的月份,如 01、11| | M | 不补零的月份,如 1、11| | dd | 补零的日期,如 02、22| | d | 不补零的日期,如 2、22| | hh | 补零的小时,如 03、23| | h | 不补零的小时,如 3、23| | mm | 补零的分钟,如 04、44| | m | 不补零的分钟,如 4、44| | ss | 补零的秒,如 05、55| | s | 不补零的秒,如 5、55| | S | 毫秒|

$date(yyyy-MM-dd-hh-mm-ss) 
// 2019-09-19-29-39-49

扩展名 $ext

原始文件的扩展名,不带英文点,如 txt、png、jpg等

随机数 $random

返回 0 ~ 10000000 间的随机数

文件索引 $index

同时上传多个文件时,$index 从0开始叠加

获取配置 $conf(path)

upload.conf.json 配置文件中的内容中获取数据,path代表路径,如 cloud.qiniu.accessKey