Why JavaScript instead of something more performant?
TBH, I think the code would be a lot simpler if it was just Bash.
That browser instance alone can make quite a noticeable difference.
docker run -it --entrypoint /bin/sh -v $PWD:/bla -v /run/docker.sock:/run/docker.sock node:12
apk add git docker cdrkit libvirt-daemon qemu-system-x86_64
npm install https://github.com/ottomatica/slim
cd /bla && /node_modules/.bin/slim
Or, do you only run software hand crafted in assembly?