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

134
Visualizações
Can we use Buffer.from in typescript frontend code

Can we use Buffer.from to Base 64 encode a string in a front end typescript application. Using btoa() is showing as deprecated.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

No you cannot. Buffer is a Node.js specific class and it does not exist in browsers.

about 4 years ago · Juan Pablo Isaza Relatório

0

The warning is beacause you have node types in your proyect, so Typescript Compiler thinks that you're using atob in node (which is totally deprecated) but you don't. You are totally fine using atob in front-end.

To solve the warning you can remove node types (if you're not using them), or to make it simple, a comentary before your atob call should be enought to avoid any warning from the next line:

// @ts-ignore
Your atob call goes here

Make sure you keep it simple under the @ts-ignore, you don't want to hidde a real problem there.

about 4 years ago · Juan Pablo Isaza Relatório
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