用文本编辑器如 npp, 键入例如以下代码存储成 hello.js
- console.log(hello)
- console.log(hello %s->%d,jeapedu, 1941847311)
- console.log(hello)
- console.log(hello %s->%d,jeapedu, 1941847311)
- node hello.js
- C:\nodeS>node hello.js
- hello
- hello jeapedu->1941847311
cmd 进入 dos 切入 hello.js 所在文件夹, 执行 node.js 程序
node hello.js
执行结果例如以下所看到的:
- C:\nodeS>node hello.js
- hello
- hello jeapedu->1941847311
来源: http://www.bubuko.com/infodetail-2486572.html