How to run node command in setup function?

@Yusuf One of the options is to output data to a file with one script. Another script unloads the required values ​​from the file.
Example:

  1. To write to the file, you will need to display the required values ​​in log cosole.log(response) and run the script with parameters k6 run test.js 2>resp.txt and then use the resp.txt file. And example this and this
  2. Try to use the setup function. @ned wrote about the possibility of overriding the timeout..
import http from 'k6/http';

export function setup() {
  let params = {
    timeout: "120s"
  };

  const res = http.get('https://httpbin.org/get', params);
  return { data: res.json() };
}

export default function (data) {
  console.log(JSON.stringify(data));
}
  1. Change the timeout in the default function as described above and place the data acquisition in 1 iteration.
if(__ITER == 0){

// Get values ​​here
}