Javascript – Create a new html file using JavaScript

htmljavascript

I want to be able to create a new html file that will be displayed and saved on the server for future use when a new user logs into their account. Can this be done using JavaScript or are there any libraries that I could get that would be able to do this?

Best Answer

This can be done through use of the fs module in node. See https://nodejs.org/api/fs.html.

However, it is very likely that this is not the best solution to the problem your solving. Instead of creating a new html file for every user, you probably want to save user details in a database and have a single html file that can be populated with the data when it's needed.