espelhamento de https://github.com/therootcompany/s3.js
Você não pode selecionar mais de 25 tópicos
Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
AJ ONeal
c95f188d61
|
4 anos atrás | |
---|---|---|
bin | 4 anos atrás | |
.gitignore | 4 anos atrás | |
.jshintrc | 4 anos atrás | |
.prettierrc | 4 anos atrás | |
LICENSE | 4 anos atrás | |
README.md | 4 anos atrás | |
index.js | 4 anos atrás | |
package-lock.json | 4 anos atrás | |
package.json | 4 anos atrás | |
test.bin | 4 anos atrás | |
test.js | 4 anos atrás |
README.md
s3.js | a Root project
Minimalist S3 client
A lightweight alternative to the s3 SDK that uses only @root/request and aws4.
- set()
- get()
- head()
- delete()
- sign()
Download a file from S3
s3.get({
accessKeyId,
secretAccessKey,
region,
bucket,
prefix,
key
});
Upload a new file to S3
s3.set({
accessKeyId,
secretAccessKey,
region,
bucket,
prefix,
key,
body,
size
});
Return signed URL without fetching.
s3.sign({
method: 'get',
accessKeyId,
secretAccessKey,
region,
bucket,
prefix,
key
});
If the body is a stream then size
must be set to fs.statSync(filePath).size
, or the request will fail:
501
<Code>NotImplemented</Code><Message>A header you provided implies functionality that is not implemented</Message>