node.js环境搭建以及入门级hello程序

一、安装 

windows下直接使用安装包安装

node.exe 的安装目录为 D:\Program Files\nodejs\

项目工程目录 D\FE\node.js\work

二、建立启动bat  start.bat

View Code
1 @echo off
2 echo now is D\FE\node.js\work
3 echo run as 'node fileName.js'
4 cd work
5 echo filelist:
6 dir /O /B /W
7 C:\Windows\System32\cmd.exe /k "D:\Program Files\nodejs\nodevars.bat"

三、在work中建立项目 word.js

View Code
1 function say(word) {
2   console.log(word);
3 }
4 
5 function execute(someFunction, value) {
6   someFunction(value);
7 }
8 
9 execute(say, "It's a word");

四、运行

至此环境搭建成功,但是node.js到底有什么用还需要进一步研究

相关文章

formidable库下载地址
https://github.com/felixge/node-formidable

Node入门

http://www.nodebeginner.org/index-zh-cn.html

原文地址:https://www.cnblogs.com/yun007/p/3023916.html