how export to txt file?

I have a code to export txt file but in RPG Maker VX ACE.

module Kernel

  def create_DNI(actor_id, variable)

    name = $game_party.members[actor_id].name 

    f = File.new("DNI.txt", "a") # Define en nombre del archivo

    f << "Nombre: #{name}\n" # Escribe el nombre del autor

    f << "ID: #{$game_variables[3]}\n" # Escribe la variable

    f.close

  end

end

 

I need this same code but in "Javascript" in rpg maker mv.

 

at my school i have to develop a project to export the DNI and User name to a txt file, but the project must operate online (web). because i chose rpg maker mv to develop it.

 

any help? thank you.
I've moved this thread to learning javascript. Please be sure to post your threads in the correct forum next time. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-export-to-txt-file.53038/