Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
Can you help me in extracting data from a listObjectsInBucket function from aws-sdk using nodejs?

I am not sure how to extract the data out of this function below. It is a function from aws-sdk I can see the console log, but I am not able to save it in a variable.. even if its a global variable.

I have always had trouble with this concept.. and if anyone could help me make more sense of it, that would be really great.

   const listObjectsInBucket =  (bucketName) => {

  // Create the parameters for calling listObjects
  let pdfList = ''

  const bucketParams = {
    Bucket: bucketName,
  };

  // Call S3 to obtain a list of the objects in the bucket
   s3.listObjects(bucketParams, function (err, data) {
    if (err) {
      console.log("Error", err);
    } else {
      pdfList = data
      // console.log("Success", data);
    }
  });
}

pdfList is undefined. :/

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda