Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. //&cls&node %0&pause > nul&exit /b 0
  2.  
  3. var cp = require('child_process');
  4. var p = console.log;
  5.  
  6. function $(a){
  7. r = ""+cp.execSync(a);
  8. p("$ "+a+"\n => "+r);
  9. return r;
  10. }
  11.  
  12. $( "echo test" );
  13.  
  14. ret = $( "node -v" );
  15. p( "nodejsバージョン:" + ret.match( /[0-9\.]+/ )[0]);
  16.  
  17. p("\n引数:"+ process.argv);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement