* Is the current environment Node.js? * * This logic is specific to Electron, because it checks * `process.type`.
()
| 245 | * `process.type`. |
| 246 | */ |
| 247 | function isNode() { |
| 248 | return ( |
| 249 | typeof process === 'object' && |
| 250 | typeof process.versions === 'object' && |
| 251 | typeof process.versions.node !== 'undefined' && |
| 252 | process.type !== 'renderer'); |
| 253 | } |
| 254 | |
| 255 | /** Get the user's home directory (Node.js only). */ |
| 256 | function getUserHomeDirectory() { |