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

223
Vistas
Is there a JS template engine that can infer the variable/context type and shape that was passed to it?

I started switching to NodeJS, and building a personal project using NextJS framework.

I come to the point where I need to implement my View-Controller.

The official documentation from NestJS suggests using "Handlebars (hbs)"

It's working fine, aside from the fact that it's really bare-bones (I literally have to write helpers/addons for simple comparative conditional statements), I also learned that it doesn't autocomplete nor infer the variables/data that I passed to the template. Or at least the VSCode cannot infer it? I just believe that it's a bummer that the View part cannot extract the Typescript benefit.

Is there another templating engine I can use which can give autocomplete suggestions, and infer variables passed to it? Example: If I pass an object {foo:"bar"} to the template, hopefully on my VSCode, it can infer that it's an object with the key foo that has a string type value.

My next solution seems to be using ReactJS, which supports typescript so I can pass the interface, DTOs, shapes, and types to it. But, hopefully, I don't have to go to this route because that means I would have to start exposing API endpoints as well. And all the overkill shenanigans I have to deal with.

Regards,

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