Perform async work synchronously using web worker and SharedArrayBuffer
```js // test.mjs import { createWorker } from 'await-sync'; const awaitSync = createWorker(); const sync = awaitSync(async () => { return new Uint8Array(); }); console.log(sync()); ``` Node.js: ```log node:internal/errors:490 ErrorCaptureStackTrace(err); ^ Error [ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --import at new NodeError (node:internal/errors:399:5) at new Worker (node:internal/worker:202:13) at #loadModule (file:///Users/JounQin/Workspaces/Study/worker-study/node_modules/whatwg-worker/node-worker.js:96:20) at new Worker (file:///Users/JounQin/Workspaces/Study/worker-study/node_modules/whatwg-worker/node-worker.js:49:21) at createWorker (file:///Users/JounQin/Workspaces/Study/worker-study/node_modules/await-sync/mod.js:14:18) at file:///Users/JounQin/Workspaces/Study/worker-study/test.mjs:3:19 { code: 'ERR_WORKER_INVALID_EXEC_ARGV' } ``` Bun.js: ```log 1 | export default Worker; ^ ReferenceError: Can't find variable: Worker at /Users/JounQin/Workspaces/Study/worker-study/node_modules/.deno/[email protected]/node_modules/whatwg-worker/browser-worker.js:1:15 ``` Deno ```log error: Uncaught (in worker "") TypeError: Could not resolve 'blob:null/a1a3f86f-a252-4652-8491-8eac3194ed14' from 'file:///Users/JounQin/Workspaces/Study/worker-study/node_modules/.deno/[email protected]/node_modules/await-sync/worker.js'. Caused by: [ERR_UNSUPPORTED_ESM_URL_SCHEME] Only file and data URLS are supported by the default ESM loader. Received protocol 'blob' at async file:///Users/JounQin/Workspaces/Study/worker-study/node_modules/.deno/[email protected]/node_modules/await-sync/worker.js:29:27 ```
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 JounQin and has received 6 comments.