Perform async work synchronously using web worker and SharedArrayBuffer
Hello! I'm investigating this library's feasibility for a course I tutor, as a less problematic (and hopefully faster) alternative to `sync-request`. However, in my test repository, the import appears to fail. ```js /home/migue/Source/COMP/1531/best-test-request/node_modules/await-sync/mod.js:4 const Work = globalThis.Worker || await import('whatwg-worker').then(m => m.default) ^^^^^ SyntaxError: await is only valid in async functions and the top level bodies of modules 2 | import inject from 'light-my-request'; 3 | import server from '../express_app/server'; > 4 | import { createWorker } from 'await-sync'; | ^ 5 | 6 | const awaitSync = createWorker(); 7 | at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1495:14) at Object.require (tests/server.test.js:4:1) ``` You can see the code I'm using by visiting [this file in my testing repository](https://github.com/MiguelGuthridge/best-test-request/blob/await-sync/tests/server.test.js). Perhaps the library is having an issue with Jest's runtime? How should I get it to work correctly?
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by MaddyGuthridge and has received 0 comments.