Note: it's been a few versions since I've last used node-webkit, but I think the below is still accurate. I tend to abbreviate node-webkit to nw, if that's okay. :)
I know window.fs and fs should both resolve, but in node-webkit, they aren't.
In nw, global
is the global object, while each nw window has it's own window
object (unless you fork nw). This may be a lil bit confusing, since using the nw devtools to create a global will actually create a property on window
as expected, so it's not unreasonable to assume you can create globals the same way as in a browser. However, that's really just a side-effect of the devtools running in nw's window context.
However, code running in nw's module context does not even have access to window
but can, of course, access global
normally.
This is documented here. The first three paragraphs specifically deal with your issue. In short, you'll want to be sure which context your code is running in.
Node's globals meanwhile have a (brief) description here.