What is your intended sorting? Just alphanumeric on the file name? On some field, or what?
If it’s a field, you could in some cases achieve the sorting by adding something like .sort(a => a.field) into the chain before the .forEach, but it’s hard to tell just from the information you’ve given so far.
The following is untested, but what if you sort the files before you do the filtering? Would that give you the correct order? Also, I’m slightly apprehensive whether the forEach() respects the order or not.