createContextAsync = async opts => {
  return new Promise((resolve, reject) => {
    Sandbox.createContext(opts, function (err, ctx) {
      if (err) {
        reject(err);
        return console.error(err);
      }
      ctx.on('error', () => {
        // log the error in postman sandbox
        console.log('createContext error: ', err);
      });
      resolve(ctx);
    });
  });
}
postman-sandbox - A sandbox for Postman scripts
Preview: https://github.dev/mojaloop/ml-testing-toolkit/blob/aa585cfeb84e6e4a13684d40992ccb73df70b2d5/src/lib/scripting-engines/vm-javascript-sandbox.js