If all it does is add attributes to window, and you want to get those back out, you can create a global called window:
global.window = {};
require('theLibrary');
// now do something with global.window.theThingItAdded
However, if the library was written for the browser, it's possible that it still won't run because it wants to use the DOM. In that case, you might want to look into jsdom, which aims to give you a spec-compliant DOM inside Node.
(If you're using jsdom, I think that you would use it instead of the global.window bit above -- I think jsdom does that for you, but with a more full-featured window object. I haven't actually used jsdom, though, so I don't know for sure.)