What you basically want is a pure Javascript DOM implementation on which you can run jQuery and guys
One such implementation exists for Node.js
https://github.com/tmpvar/jsdom
It can spoof a DOM window object, API, etc.
You can take the code, break the dependencies of Node and try to apply jQuery at the top of this web worker.
source share