Parse text file using JS

Hello little kirupians, here’s a little question for you:

I have a text file, written in such way


imagepath1/imageA.jpg
imagepath2/imageB.jpg
imagepath3/imageC.jpg
imagepath4/imageD.jpg
...

(the .txt is actually 1Mib large)

Can I parse this text file in an html page using javascript, so each line belongs to an array ? Using split works for characters, but could it work with the linebreak ?

thanks

mlk

ps: if anyone knows a way to declare a large chunk of text as a variable (I can’t seem to be able to use multi-line variable withouth writing ‘’ at the end of each line), it would help me greatly !