We started using runkit for creating reproducible examples and it has worked reasonably well. We found one major stumbling block: there’s no way to specify the filename or even the extension for buffer output.
This case builds up an XLSX file. Normally in NPM we would use
XLSX.writeFile but that ultimately calls
fs.writeFileSync which, based on other issues in the forum, is apparently not supported. That’s fine, our workaround is to return a Buffer that you can download. The problem with this approach is that you can’t specify an extension. In this case, since XLSX files are ultimately ZIP containers, runkit guesses that the output is a zip file.
Is there a way to configure the buffer display to force a file extension?