Hi ,
During project development, I wanted to create a TXT file and add a log to this file. Thanks to Wappler’s expandable feature, it was quite good to prepare it in my own way and use it the way I want. Now I can create a file as I want and add the logs I want to it.
I thought that instead of writing the logs on your site to the database, you might want to write them in a txt file or a file with the extension you want.
Write To File
It is very simple to use, I am sure you will see how simple it is by examining a little bit.
Thanks very much @s.alpaslan. This is a really useful module - for writing/reading text files for various purposes (as well as log files). It’s one of those basic features which is surprisingly still not built into Wappler.
Was there a particular reason you’ve only included ‘a’ and ‘a+’ as options for the read/write mode? It’s easy enough to add them to the .hjson file.
(I’ve also learnt 3 three new words in Turkish, bringing my vocabulary to a total of 3 words - until I forget them)
With a and a+ modes, it will create the file if it does not exist and generate the file content. In other words, if they use a different mode according to the purpose, they will see a problem and think that the reason for this error is due to the module. That's why I just added a and a+ . All mods can be added inside the hjson file.
I wrote this for my project requirement at that time, but of course it can be written in nodejs. ( I can’t give information about the duration. I’ve been working for a big project for a long time. )
@s.alpaslan thanks for creating this. I’ve just used it in conjunction with @sid API file upload extension and it works perfectly. Very much appreciated.
It would be great to see this capability integrated into Wappler.