Firefox extension: Store and Export data as CSV

I am new to building Firefox extension, and I am looking for a way to save data as a csv file in storage.local or any other storage solution, and export that file, I have the csv data in an array. the code snippets found on MDN didn’t help much. Any suggestion is much appreciated

Source: Ask Javascript Questions