For a given AWS S3 bucket, all objects, their versions, and the bucket will be deleted.
npm install --save delete-aws-bucket
The first argument is the bucket name, and the second argument is an optional config object passed to the AWS SDK.
deleteBucket(bucketName, [config]);
const deleteBucket = require('delete-aws-bucket');
deleteBucket('my-bucket');
const awsConfig = {
accessKeyId: 'AKID',
secretAccessKey: 'SECRET',
region: 'us-west-2'
};
deleteBucket('other-bucket', awsConfig);
The AWSJS_DEBUG
environment variable enables logging in aws-sdk
. If the AWSJS_DEBUG
environment variable is set this module will log debug information also.