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

156
Vistas
How to get the value of the Promise after it is resolved in node REPL

I have some code like this which I am trying in Node REPL:

result = lib.utils.kv["@0.1.16"]
    .get({ key: "t2" });

Now I want to access the value in the string after it is resolved. When I try to print result, I first get Promise { <pending> }

Then after sometime, I get

Promise {
        `'{"locations":{"CH":5000013960,"AE":5000013961,"AF":5000013961}}'`
}

I want to get the output without the Promise prefix, and also ideally without that backtick.

I have tried to use an alternative syntax, but not sure whether this is the only way and whether this is even the right way?

(async () => {
  result = await lib.utils.kv["@0.1.16"]
    .get({ key: "t2" });
  console.log(result);
})();
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