Changes to Node
Since NW.js supports GUI applications instead of console applications, the output of
console.log() (and other similar methods such as
console.error()) is redirected to the console of Chromium. You may see it in your “Developer Tools” window (on its “Console” tab).
A couple of new fields is added to the global
process.versions['nw']is set with NW.js’s version.
process.versions['chromium']is set with the chromium version which NW.js is based on.
process.mainModuleis set for the start page (such as
index.html) as specified in the manifest’s
mainfield. However, when the
node-mainfield is also specified in the manifest,
process.mainModulepoints to the file specified in the
Behaviour of relative paths in Node’s
require() method is called):
- If the parent file is running in Node context, the child’s relative path is treated as relative to its parent.
- If the parent file is running in browser context, the child’s relative path is treated as relative to the application’s root directory, i.e. the directory of manifest file.