A simple, lightweight s3 client. Only 2 dependencies total.
Não pode escolher mais do que 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 1.1.1 há 4 anos
bin v1.0.3: add bin há 4 anos
.gitignore v1.0.2: improve docs and error messages há 4 anos
.jshintrc v1.0.0: a diet s3 client há 4 anos
.prettierrc v1.0.0: a diet s3 client há 4 anos
LICENSE v1.0.0: a diet s3 client há 4 anos
README.md add ability to sign() without fetch há 4 anos
index.js bugfix using manual host (minio) for bucket há 4 anos
package-lock.json 1.1.1 há 4 anos
package.json 1.1.1 há 4 anos
test.bin v1.0.0: a diet s3 client há 4 anos
test.js v1.0.2: improve docs and error messages há 4 anos

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>