Code Monkey home page Code Monkey logo

Comments (6)

ssaunders avatar ssaunders commented on August 12, 2024

From looking at the code, it seems not. Though changing that would be easy. If you remove the parentheses on the last line, you can pass them as parameters to the initialize function. That means you have to initialize it, though.

//UNTESTED
var awsS3Promisified = {

  initialize: function(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) {
  ...


};

module.exports = awsS3Promisified.initialize;   <<<<< like this

You may need to remove the parameters as well, in case there are conflicts.

from awss3promisified.

mrn3 avatar mrn3 commented on August 12, 2024

Great thanks!

from awss3promisified.

alliejanoch avatar alliejanoch commented on August 12, 2024

Hi @mrn3 - I just made a little update to make this easier. You should now be able to do:

var aws = require('aws-s3-promisified').initialize(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY);

from awss3promisified.

SamSamskies avatar SamSamskies commented on August 12, 2024

@alliejanoch I think you have a typo in that example. Shouldn't it be...

var aws = require('aws-s3-promisified').initialize(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY);

Also, I think what @ssaunders makes sense. It would be a little nicer to not have to explicitly call initialize. This would be a breaking change to the API though.

var aws = require('aws-s3-promisified')(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY);

from awss3promisified.

alliejanoch avatar alliejanoch commented on August 12, 2024

@mrn3 - I've released a new version of the library. This will break code that worked with previous versions. You can now initialize like this:

var aws = require('aws-s3-promisified')({
    accessKeyId: AWS_ACCESS_KEY_ID,
    secretAccessKey: AWS_SECRET_ACCESS_KEY
});

from awss3promisified.

mrn3 avatar mrn3 commented on August 12, 2024

Great thanks!

from awss3promisified.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.