How do you read/write .txt files in JavaScipt?

I am making a guitar music game like rockband or guitar hero. I have a great editor, but now I need something that will write the position of each note in the game to a text file. All I want is it written in a certain format

Song Name // the first thing written and read is the song name
Beginner Start // when this is read it knows now that the following notes will be created only if the difficulty is set to beginner
NormalGreen,5.00 // when this is read then the game will create a normal green note at the x position 5.00
Beginner End // this is the end of the beginner file

So if you can understand that, I just want to write the positions of all of the notes in the game in a format similar to above, and each song will load its own text file. This file for the song will hold each note for each difficulty, and the sole purpose of this is because I made an editor and I want the important information transferred to the actual game. How do I do this? And I would like to use JavaScript. I only started learning it recently and I can’t start another language. Thanks!