mr.zog mr.zog - 2 days ago 3
Node.js Question

window object in node.js interactive shell

I installed the node.js v6.9.1 and typed window but received only an error. In the Chrome js console, window prints "window" and if you click on the triangular link you can see all the window.whatever functions. How do I get that same result using the node shell?

Thanks.

Answer

You can't. There is no window in Node. Window is part of the browser which is totally absent in Node.

The Node Shell is referred to as the REPL

Window (from MDN)

The window object represents a window containing a DOM document; the document property points to the DOM document loaded in that window.

Comments