const openssl = require('./openssl.js/dist/openssl.cjs');
const path = require('path');
const fs = require('fs');
let fakeFs = {
existsSync : () => true
};
var openSSL = new openssl.OpenSSL({ fs : fakeFs });
(async function () {
// Fails with "No such file or directory", but fakeFs.openSync is never called
await openSSL.runCommand('base64 -d -in /file.txt');
fs.writeFileSync('file.txt', 'dGVzdAo=\n');
// Prints the (base64-decoded) contents of the real file.txt
await openSSL.runCommand('base64 -d -in ' + fs.realpathSync('file.txt'));
})();