-1

I need to generate a file from a template, but I need it to create an actual html file. When I use templating engines like pug or haml, I've got one pug (haml) file that gets rendered with the variables I provide.

But I need to have a template with variables and then generate a new, actual static html file created from that template with said variables.

How can I do that?

Filip
  • 855
  • 2
  • 18
  • 38
  • https://nodejs.org/api/fs.html#fs_fs_write_fd_buffer_offset_length_position_callback – Quentin Apr 21 '20 at 09:54
  • Did you read the question? What you linked and the post this was marked as a "duplicate" of does not answer my question whatsoever. – Filip Apr 21 '20 at 10:09
  • You want to know how to create a new static file from a template. You already know how to use a template engine. The duplicate covers the remaining bit. It does answer it. – Quentin Apr 21 '20 at 10:15

1 Answers1

-1

You can use something like handlebars. Handle bars CLI allows to convert the template to HTML file.

ngprnk
  • 82
  • 2
  • 6