If the size of each record is fixed I would preallocate the file for specific period/number of records and used just https://www.espruino.com/Reference#l_Storage_write directly and then just fill it later record by record. Once full I'd start with another preallocated file. I'd keep current offset in variable in RAM or find where is last record by scanning the data if the variable got lost (e.g. after reset or dead battery). That way I wouldn't need to know the length. If the record is variable I'd include length into each record.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
If the size of each record is fixed I would preallocate the file for specific period/number of records and used just https://www.espruino.com/Reference#l_Storage_write directly and then just fill it later record by record. Once full I'd start with another preallocated file. I'd keep current offset in variable in RAM or find where is last record by scanning the data if the variable got lost (e.g. after reset or dead battery). That way I wouldn't need to know the length. If the record is variable I'd include length into each record.