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

114
Vistas
Reading from AWS S3 is not returning response

I am new to AWS S3 and I am trying to read a csv from an S3 folder. For which I have the below logic.

var prefixList = [];

async function readConfig() {
  const AWS = require("aws-sdk");
  const s3 = new AWS.S3();
  const csv = require("csv-parser");
  const bucket = "my-bucket";
  const objectkey = "/my/folder/path/filename.csv";
  const params = { Bucket: bucket, Key: objectkey };

  const configFile = s3.getObject(params).createReadStream();

  configFile.pipe(csv()).on("data", (data) => {
    prefixList.push(data["PREFIX"]);
  });

  logger.info("PrefixList: " + prefixList);
}

I am trying to print the list and it prints an empty list. The list is not getting appended by the elements from the csv file.

I have confirmed that the file is there in the bucket/folder path I have mentioned. And also, the header PREFIX is present in the csv file. But still something is preventing the push to the list.

Am I missing something here? Please help

EDIT:

Contents in the S3 file:

--------
PREFIX
--------
MR
MRS
MISS
MS
DR
REV
PROF
SIR
--------
about 4 years ago · Santiago Trujillo
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