NyllRE / nuxt-file-storage

Easy solution to store files in your nuxt apps. Be able to upload files from the frontend and recieve them from the backend to then save the files in your project.
https://nuxt.com/modules/nuxt-file-storage
MIT License
74 stars 10 forks source link

Fix blocking I/O #1

Closed riobits closed 7 months ago

riobits commented 9 months ago

The writeFile function helps prevent blocking I/O. Please test the code because I didn't test it.

riobits commented 9 months ago

Error handling should be managed inside a try/catch block. Documentation needs an update.

  1. Error handling
    try {
    await storeFileLocally(
    file.content, 
    file.name, 
    '/userFiles'
    )
    } catch(err) {
    // ...
    }
  2. Explain the deleteFile function