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

upyun-js

v1.0.5

Published

A pretty encapsulation of upyun js sdk

Downloads

45

Readme

languuage npm package NPM downloads license

简体中文 | English

✨ 特性

  • 提供更为友好的接口
  • 新增对目录的 CRUD 操作

📦 安装

npm install upyun-js

🔨 接口

初始化

const Upyun = require('upyun-js');
const config = {
  serviceName: 'upyun service',
  operatorName: 'upyun operator',
  operatorPassword: 'upyun password'
};

const upyun = new Upyun(config);

下载文件 upyun.downloadFile

/**
  * @param {String} remotePath // 远程文件路径
  * @param {String} localPath // 本地文件夹
  * @return {Promise}
  */
upyun.downloadFile(remotePath, localPath);

下载文件夹 upyun.downloadDir

/**
 * @param {String} remotePath: 远程文件夹
 * @param {String} localPath: 本地文件夹
 * @return {Promise}
*/
upyun.downloadDir(remotePath, localPath);

上传文件 upyun.uploadFile

/**
 * @param {String} remotePath: 远程文件夹
 * @param {String} localFile: 本地文件
 * @return {Promise}
*/
upyun.uploadFile(remotePath, localFile, opts);

上传文件夹 upyun.uploadDir

/**
 * @param {String} remotePath: 远程文件夹
 * @param {String} localPath: 本地文件夹
 * @return {Promise}
*/
upyun.uploadDir(remotePath, localPath);

删除文件 upyun.rmfile

/**
 * @param {String} remoteFile: 远程文件
 * @return {Boolean}
*/
upyun.rmfile(remoteFile);

删除文件夹 upyun.rmdir

/**
 * @param {String} dirname: 远程文件夹
 * @return {Boolean}
*/
upyun.rmdir(dirname);

创建文件夹 upyun.mkdir

/**
 * @param {String} remotePath: 远程路径
 * @return {Any}
*/
upyun.mkdir(remotePath);

缓存刷新 upyun.refresh

/**
 * @param {Array<String>} urls: 待刷新的远程文件数组
 * @return {Promise}
*/
upyun.refresh(urls);

获取文件基本信息 upyun.getFileMeta

/**
 * @param {String} remotePath: 远程文件
 * @return {Promise}
*/
upyun.getFileMeta(remotePath);

查看目录大小 upyun.usage

/**
 * @param {String} remotePath: 远程目录
 * @return {Promise}
*/
upyun.usage(remotePath);

获取目录下的文件列表 upyun.listDir

/**
 * @param {String} remotePath: 远程目录
 * @param {Object} opts: 获取列表数据可选的 limit、order 或 iter 值
 * @return {Promise}
*/
upyun.listDir(remotePath, opts);

🐤 相关

upyun js sdk

upyun-webpack-plugin