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

node-upyun-plugin

v1.2.3

Published

UPYUN uploader written in Node

Downloads

7

Readme

node-upyun-plugin

又拍云云存储 Node.js 文件上传工具

npm version

效果演示

https://i.imgur.com/7B64sRo.gif

安装

npm install -D node-upyun-plugin

使用方法:

在项目根目录新建 upyun.js 文件(示例),并按照如下信息填入:

const UpyunService = require('node-upyun-plugin');

// 填入又拍云的信息
const us = new UpyunService({
  name: 'example name', // 服务名称
  operator: 'example operator', // 操作员
  password: 'example password', // 操作员密码,如 CSCn3zXXqUNQUl6wrDv1xCAA0NlBro88
  folderPath: 'build' // 上传目录,无需 './'
});

us.upload(); // 上传

如果想如效果演示般在命令行运行,可于 package.json 中添加一条命令:

// package.json
...

  "scripts": {
    ...
    "upyun": "node upyun.js"
    ...
  }

...

API 调用

1. upload(options)

上传文件

参数

  • options: (可选)
    • removeAll: 是否上传前,先删除所有文件,默认 false
    • localPath: 指定上传目录,默认为 folderPath
    • remotePath: 指定上传到又拍云的目录,默认为根目录

示例

const options = {
  removeAll: false,
  localPath: 'build/static',
  remotePath: 'path/to/example'
};
us.upload(options);

2. removeAll()

删除目录所有文件

3. removeFile(path)

删除某个文件

示例

us.removeFile('static/media/icon-unliked.04c36067.svg');

4. listDir(remotePath = '/', limit)

展示某个文件夹的所有文件

示例

us.listDir('static', 200);

支持

若本插件对您有帮助,欢迎 star 和 fork。

如果在使用过程中发现有问题或疑问,欢迎提交 issue