🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

flush-s3-bucket

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flush-s3-bucket

Delete all files in an S3 bucket.

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

flush-s3-bucket

Delete all files in an S3 bucket.

Table of Contents

  • Install
  • Usage
  • API
  • Maintainers
  • Contribute
  • License

Install

$ npm install flush-s3-bucket

or

$ yarn add flush-s3-bucket

Usage

import { S3 } from 'aws-sdk';
import { flushS3Bucket } from 'flush-s3-bucket';

/**
 * For details on configuration (e.g. credentials) refer to:
 * https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/configuring-the-jssdk.html
 */
const s3 = new S3();

flushS3Bucket(s3, 'my-bucket-name', err => {
  if (!err) {
    console.log('The bucket is empty!');
  }
});

No need to checkout @types. Since the package itself is written in TypeScript typings are included.

Maintainers

@fahrradflucht

Contribute

PRs accepted.

Running the tests

Since the task of the library is inherently bound to an external service mocking would probably make the tests useless. Therefore all tests integration level and need a S3 endpoint which is configurable through the S3_ENDPOINT environment variable.

The tests are known to run successfully against zenko/cloudserver and obviously real AWS S3 (which nonetheless is not recommended due to cost and speed) while they are known to fail against localstack/localstack because of bugs in its versioning implementation (though the library should still work on unversioned localstack buckets).

License

MIT Š 2018 Mathis Wiehl (@fahrradflucht)

Keywords

empty

FAQs

Package last updated on 18 Apr 2020

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