Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!