Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-50-spawn / test-node.js
481 bytesRaw
1 | |
2 | |
3 | 'use strict'; |
4 | |
5 | var spawnSync = require('child_process').spawnSync; |
6 | |
7 | var child = spawnSync( |
8 | process.execPath, [ |
9 | '-e', 'process.stdout.write("42")' |
10 | ], { |
11 | stdio: 'pipe', |
12 | // if run under node (process.execPath points to node.exe), |
13 | // then node ignores PKG_EXECPATH, but if run as pkged app, |
14 | // PKG_INVOKE_NODEJS is a hack to access internal nodejs |
15 | env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' } |
16 | } |
17 | ); |
18 | |
19 | console.log(child.stdout.toString()); |
20 |
Built with git-ssb-web