Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
aliyun-oss
Advanced tools
npm install aliyun-oss
const OSS = require('aliyun-oss')
const option = {
accessKeyId: 'your access key id',
accessKeySecret: 'your access key secret'
}
/*
* 可选 option
*
* host: default is: oss-cn-hangzhou.aliyuncs.com,
* timeout: default is: 300000,
* agent: default is: agent.maxSockets = 20
*/
const oss = OSS.createClient(option)
params
callback params
status
, headers
, body
/*
* source: 上传的文件, 可以是文件路径、 buffer、 stream
* headers: 可选,用户自定义 header,如: x-oss-meta-location
* 当上传方式为: buffer 或者 stream, 建议添加 'Content-Type'(此时无法根据扩展名判断)
*/
oss.putObject({
bucket: '',
object: '',
source: '',
headers: {
// optional
'Content-Length': 1024
}
}, function (err, res) {
console.log(res.objectUrl);
});
oss.copyObject({
bucket: '',
object: '',
sourceBucket: '',
sourceObject: ''
}, function (err, res) {});
oss.deleteObject({
bucket: '',
object: ''
}, function (err, res) {});
oss.deleteObjects({
quiet: true, // optional, default is false
bucket: '',
objects: ['']
}, function (err, res) {});
/*
* dest: 保存object的文件路径 或者 writeStream
* headers: 可选,object类型,用户自定义header,如: If-Unmodified-Since
*/
oss.getObject({
bucket: '',
object: '',
dest: '',
headers: {}
}, function (err, res) {});
oss.headObject({
bucket: '',
object: ''
}, function (err, res) {});
/*
* prefix: 可选,object 前缀
* marker: 可选,列表起始object
* delimiter: 可选,object分组字符,若'/'为则不列出路径深度大于等于二层的object。
* maxKeys: 可选,列出的object最大个数
*/
oss.listObject({
bucket: '',
prefix: '',
marker: '',
delimiter: '',
maxKeys: ''
}, function (err, res) {});
oss.listBucket(function (err, res) {});
oss.createBucket({
bucket: '',
acl: ''
}, function (err, res) {});
oss.deleteBucket({
bucket: ''
}, function (err, res) {});
oss.getBucketAcl({
bucket: ''
}, function (err, res) {});
oss.setBucketAcl({
bucket: '',
acl: ''
}, function (err, res) {});
add node stuff in your webpack.config.js
{
node: {
fs: 'empty'
}
}
MIT
FAQs
a new version of oss-client
We found that aliyun-oss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.