saveInvocationResult = (result) => {
  const filePath = path.join(os.tmpdir(), `sls_${process.pid}.json`)

  const stringifiedResult = JSON.stringify(result, null, 2)

  fs.writeFileSync(filePath, stringifiedResult)
}
Saves the invocation result to a temporary file in JSON format.
The file is named with the process ID to avoid conflicts between concurrent invocations.
The result includes both the response and the error if any.

@param {*} result
@returns {void}