+ 1

VanillaJS read and write

VannilaJS is pure JavaScript language and many big companies are using VannilaJS, you can create a complete working website. It has lots of advantages like speed. VannilaJS has speed compared to other libraries made from JavaScript because many devices already support JavaScript while libraries has to be connected to server to excite the task. VannilaJS also have some some disadvantages like security. You cannot write or read a file from local storage for security reasons. Which push us to use libraries. My question is that can you read and write a file from local storage if you're using a server or inside the server.

3rd Nov 2022, 6:59 AM
Trevor Netshisaulu
Trevor Netshisaulu - avatar
1 Resposta
+ 2
If you run JavaScript on the server, you are most likely using Node.js which has an API to access the filesystem. https://nodejs.org/api/fs.html "The node:fs module enables interacting with the file system in a way modeled on standard POSIX functions." For client side, check this one about accessing the filesystem through HTTPS (supported by most but not all browsers) https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
3rd Nov 2022, 8:15 AM
Tibor Santa
Tibor Santa - avatar