Parsing HLS and MPEG-DASH with Node.js is very easy. The following NPM modules will help you to achieve your goals.
m3u8-parser
mpd-parser
No doubt these modules are easy to use for parsing manifest files but, the real challenge is to write modified manifest back to the file in a specific format.
Unfortunately, there is no Node.js module available to write parsed manifest back to the file so you have to write it yourself.