Sindre Sorhus

Results 4149 comments of Sindre Sorhus

> IIRC, when @addaleax implemented worker_threads, she modeled the API on Web Workers but it was not possible to support the entire API, so it diverged in places. I'm curious...

> That’s arguably a sign against inclusion in Node.js core, unless you have a reason to believe that development as part of Node.js would improve this situation (isn’t obvious to...

> It could also be a sign that worker_threads are "close enough" to discourage further effort there. Why add `fetch` then? `http.get` is close enough. Why add Web Streams? Node...

My use-case: I try to make my packages work in both Node.js and browser whenever possible. Sometimes I would like to offload CPU heavy work to a worker (important to...

I'm certain Node.js will have a spec compliant Web Worker API at some point (whether it's now or in 10 years). Same as I was certain Node.js would get `fetch`...

> Maybe start with a simple question: What does the global scope inside a Web Worker spawned by Node.js look like? Does it match WorkerGlobalScope? Does it match a regular...

To make it easier to implement this, I would personally be fine with it only supporting [module-type workers](https://web.dev/module-workers/#enter-module-workers): `new Worker('x.js', {type: 'module'});`

> I used for node and browsers this package: https://www.npmjs.com/package/threads This package would benefit from Node.js supporting Web Workers as it would not need separate code paths for Node.js and...

> A plain Web Worker environment offers rather limited functionality. I think it's telling deno decided to expose the (obviously non-standard) Deno object to provide a better out-of-the-box experience. Which...

Thanks for making an Awesome list! 🙌 It looks like you didn't read the [guidelines](https://github.com/sindresorhus/awesome/blob/master/pull_request_template.md) closely enough. I noticed multiple things that are not followed. Try going through the list...