lukehaas / RunJS

RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
https://runjs.app
2.05k stars 45 forks source link

Workers? #637

Closed paul-uz closed 3 months ago

paul-uz commented 3 months ago

How can I test out basic examples of workers, as the Worker method needs to point to a local JS file?

lukehaas commented 3 months ago

Could you provide some sample code? There should be no issue pointing to a local file in RunJS.

paul-uz commented 3 months ago

Sorry, it was more a case of, how best to do this.

I could reference a file somewhere on the computer yes, but with RunJS not really having "files" as such (when just running the app and using it to test code), what is the best approach to go about testing worker code?

lukehaas commented 3 months ago

You can save and edit files in RunJS. When you've saved a file, you then have a location on your filesystem for that file, and you can refer to it from RunJS.

paul-uz commented 3 months ago

That's what I thought. Was hoping there was a way to do it without having to specifically save the file.