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

162
Visualizações
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 à 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