Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda