初始 node.js蜈块,并基本了解 npm 的簡單用法请契。
安裝 node.js 最新 LTS 版逃呼,并嘗試使用 npm 下載指定包實(shí)現(xiàn)簡單的命令行效果。
任務(wù)要求
要求使用 Git 進(jìn)行版本管理岗憋,須在bingyan-camp-[你的名字全拼]下的task3文件夾中編寫代碼。
使用 npm 命令锚贱,初始化package.json并安裝colors包仔戈。
新建 index.js 文件,使用 node.js 運(yùn)行惋鸥,并嘗試用代碼在其中輸出彩虹色的Geek is the new sexy!杂穷。
學(xué)習(xí)感想
git進(jìn)行版本管理:更新文件夾中的內(nèi)容,指令git add卦绣;git
commit -m耐量;git push origin master
npm命令初始化package.json并安裝colors包:http://blog.csdn.net/qq_35441998/article/details/55270816
https://www.npmjs.com/package/colors
在webstorm中新建了index.js文件并用color包代碼實(shí)現(xiàn)彩虹色Geek is
the new sexy!滤港,最后使用node.js運(yùn)行時(shí)出現(xiàn)了問題廊蜒,輸入node再回車,再輸入index.js溅漾,這樣的情況下山叮,node是進(jìn)入命令交互模式,可以輸入一段代碼句后立即執(zhí)行并顯示結(jié)果添履。如果需要通過node命令運(yùn)行一個(gè)文件屁倔,則需輸入node index.js