Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wanna try out a new worker? #104

Closed
jimmywarting opened this issue Apr 19, 2023 · 1 comment
Closed

wanna try out a new worker? #104

jimmywarting opened this issue Apr 19, 2023 · 1 comment

Comments

@jimmywarting
Copy link

I have developed a new web worker for nodejs with a bit enhancement over the original author.
it supports creating web worker from blob urls. so you don't have to make any weird complicated base64 urls
URL and blobs are supported in nodejs too nowdays

import Worker from 'whatwg-worker'
const code = 'console.log(1)'
const blob = new Blob([code], { type: 'text/javascript' })
const url = URL.createObjectURL(blob)

worker = new Worker(url)

Works the same way in both browser and nodejs
ofc if you would like to see fewer dependencies i highly suggest you to give this nodejs/node#43583 a 👍

@phated
Copy link
Contributor

phated commented Apr 22, 2023

I think we'll stick with our current implementation until node matches the global worker syntax.

@phated phated closed this as completed Apr 22, 2023
@phated phated closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants