New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

oss-easy

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oss-easy

An aliyun oss service client for NodeJS, provides batch processing, exposes api more like nodejs.fs. 阿里云 OSS 服务的SDK,提供简单好用的API接口,支持批量操作处理

latest
Source
npmnpm
Version
0.3.6
Version published
Maintainers
1
Created
Source

oss-easy

an aliyun oss service client for nodejs, exposes api more like the file system module of Node.JS 一个阿里云 OSS 服务的 Node.JS 模块,提供类似 fs 的 API。同时提供一些方便的批量操作方法

Documentation

Init bucekt client instance

OssEasy = require("oss-easy")
ossOptions = {
  accessKeyId : "your oss key"
  accessKeySecret : "your oss secret"
}
var oss = new OssEasy(ossOptions, "bucket_name");

Write data to bucket

oss.writeFile('remote/path/to/filename', 'content could be string of buffer', function(err) {
    if(err) console.log(err);
});

Upload a local file to bucket

oss.uploadFile('path_to_local_file', 'remote/path/to/filename', function(err) {
    if(err) console.log(err);
});

Upload multiple local files to bucket in one batch

var tasks = {
  'local/path/to/filename0': "remote/path/to/filename0",
  'local/path/to/filename1': "remote/path/to/filename1",
  'local/path/to/filename2': "remote/path/to/filename2",
};
oss.uploadFiles(tasks, function(err) {
    if(err) console.log(err);
});

Download a file from bucket

oss.downloadFile('remote/path/to/filename', 'path_to_local_file', 'function(err) {
    if(err) console.log(err);
});

Download multiple files from bucket

var tasks = {
  "remote/path/to/filename0": 'local/path/to/filename0',
  "remote/path/to/filename1": 'local/path/to/filename1',
  "remote/path/to/filename2": 'local/path/to/filename2',
};

oss.downloadFiles(tasks, function(err) {
    if(err) console.log(err);
});

Delete a file from the bucekt

oss.deleteFile(filename, function(err) {
    if(err) console.log(err);
});

Delete all remote files under a given folder path

oss.deleteFolder('remote/path/to/folder', function(err) {
    if(err) console.log(err);
})

Delete multiple remote files from bucket in one batch

oss.deleteFiles(['remote/path/to/filename0','remote/path/to/filename1'], function(err) {
    if(err) console.log(err);
});

Test

mocha tests

License

Copyright (c) 2013 yi Licensed under the MIT license.

Keywords

oss

FAQs

Package last updated on 21 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts