k6filewriter
xk6 Module for creating and writing/logging strings into local files during a loadtest with k6. If the directories and subdirectories do not exist,
the writeString() function will create them and the file with permission bits 0750. However, if they exist, the writeString() method will act like the appendString()
method. The appendString() function will just add the respective string into the end of the file.
Installation
To use the module, you need to build k6 with this module. To archieve this you need xk6. If you have installed it successfully,
you can build your k6 with the module with the command below:
xk6 build --with github.com/Shaedow4/k6filewriter
Usage in code
To use the module in your k6 Javascript code, import the module with the following line and call the writeString() and appendString() method
import filewriter from "k6/x/filewriter";
//create a new file and write a string
filewriter.writeString("path", "filename", "myAddedString")
//append to an existing file
filewriter.appendString("path", "filename", "myAddedString")
License: Apache License 2.0