title: how to save and read file from %temp% using node js?
body: <p>This is the code that creates a blob file and save that in folder, i want to save the screen.webm into the windows temp folder and read the files from the same folder later on</p>
  <pre><code>async function handleStop(e) {
      const blob = new Blob(recordedChunks, {
          type: 'video/webm'
      });
  
      const buffer = Buffer.from(await blob.arrayBuffer());
  
      const { filePath } = await dialog.showSaveDialog({
          buttonLabel: 'Save video',
          defaultPath: `vid-${Date.now()}.webm`
      });
  
      fs.writeFile('screen.webm', buffer, function(err){
          if(err) throw err;
          console.log(err)
      })
      if (filePath) {
          writeFile(filePath, buffer, () =&gt; console.log('video saved successfully!'));
      }
  
      while(recordedChunks.length&gt;0){
          recordedChunks.pop()
      }
  }
  </code></pre>
  <p>this function is broken as it will save the file in the same folder in which the js file is. and as backup i also added a user prompt so that user can save the file in the desired folder. i am usnig Electron JS to build a screen recorder.</p>