From f7d07cceeac2baf95f1002553f8bb434261ce80b Mon Sep 17 00:00:00 2001 From: Cyrille Date: Wed, 8 May 2019 17:51:29 +0100 Subject: [PATCH] Log only on debug --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 7ea178b..b0312e7 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,12 @@ const s3 = new AWS.S3({ apiVersion: '2006-03-01' }); module.exports.create = (createOptions) => { const options = Object.assign({}, defaultOptions, createOptions); + if (!options.debug) { + console = console || {}; + console.log = () => { }; + console.error = () => { }; + } + AWS.config.update({ region: options.bucketRegion , credentials: new AWS.Credentials({