now node.js is working on a project that wants to implement a function. The specific operation is to fs.write a file at a time, and then read the file later. The question now is how to add 1 to the name of this file every time you write it. Then each read is the previous file written this time.
for example, this time I want to save the file named R1, and the next save will be named R2. and so on. Then when I store R2, I can read R1 in the next step. I can read R2 when saving R3.
simply means that you save the file each time, and then read the file you saved last time, not the one you saved this time. I don"t know if there is any good way.