jquery.documentsize
jquery.documentsize copied to clipboard
What's the right way to use this library in node?
Assuming that I already have a window/document object globally available for this library to do its work, how should I import it and bind it in node.js?
I was expecting something like const $ = require(jquery.documentsize);
to work, but that's not working.
According to the documentation, this library needs a $
to binds itself to that variable, but I still don't understand how I make the library available to a hypothetical var $ = {}
object if I'm not explicitly calling it against its import variable.
So what's the correct version of using this with Node.JS. Again, you can assume that I already have a window object. For the sake of the example something like this:
require("jsdom").env("", function(err, window) {
if (err) {
console.error(err);
return;
}
Any ideas?
Cheers,