parallel-js / parallel.js

Easy multi-core processing utilities for Node.
MIT License
3.23k stars 199 forks source link

Inside a web worker runs as in a node environment #242

Open SarantopoulosKon opened 2 years ago

SarantopoulosKon commented 2 years ago

Inside a web worker runs as in a node environment since window is not defined

const isNode = !(typeof window !== 'undefined' && this === window); // Returns true since there is no window object inside a web worker