node.js(npm)|bower(bootstrap)|git

node.js

安裝步驟:http://www.runoob.com/nodejs/nodejs-install-setup.htmlcss

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.html

簡單的說 Node.js 就是運行在服務端的 JavaScript。前端

Node.js 是一個基於Chrome JavaScript 運行時創建的一個平臺。node

Node.js是一個事件驅動I/O服務端JavaScript環境,基於Google的V8引擎,V8引擎執行Javascript的速度很是快,性能很是好。linux

其實只是爲了使用sublimeLinter……嗯嗯:http://segmentfault.com/a/1190000000389188laravel

測試是否安裝成功(cmd):node -vgit

 

簡單的例子-helloworld.js github

寫一段簡短的代碼,保存爲helloworld.js,大體看下nodejs是怎麼用的。npm

以下:該代碼主要是建立一個http服務器。json

var http = require("http");  
http.createServer(function(request, response) {  
    response.writeHead(200, {"Content-Type": "text/html"});  
    response.write("Hello World!");  
    response.end();  
}).listen(8080);  
console.log("Server running at http://localhost:8080/");

打開命令行,轉到當前文件所存放的路徑下,運行 node helloworld.js命令便可

若是一切正常,能夠看到命令行輸出:Server running at http://localhost:8080/

爲了安裝npm[Node Package Manager]因此下載git (安裝的無限死循環 | git for windows

git安裝

是否是該去學一下unix和linux了……

而後,看到:新版的node.js已經集成了npm……哦,已經集成了= =

好吧輸入npm -v,果真,版本:2.14.7

 

bower

嗯嗯既然npm已經有了就準備安裝bower | http://bower.io/

npm install -g bower

能夠用bower -v檢查是否安裝成功。 |教程

準備bootstrap

 

Reffer:用Laravel+Grunt+Bower管理你的應用

這裏是要用bower爲項目準備前端框架

 

在public下,建立assets目錄,把css、js、fonts文件都放進去

項目根目錄下配置文件.bowerrc爲

{
  "directory": "public/assets/bower"
}

 

接着在根目錄(Laravel5)建立一個bower的配置文件bower.json爲

{
  "name": "Laravel5"
}

接着添加前端庫

bower install bootstrap -S

在這裏總會出現: ENOGIT   git is not installed or not in the PATH

在萬能的stackoverflow裏又找到解決辦法(成功的是點贊只有13的= =| link

set PATH=%PATH%;c:\Program Files\Git\bin;

而後再執行bower install就成功了~

 

這個命令將會利用配置文件管理整個庫依賴,這個時候再看一下配置文件,bower已經幫助咱們自動安裝好了Bootstrap依賴的包--jQuery,同時修改了配置文件

{
  "name": "laravel5",
  "dependencies": {
    "bootstrap": "~3.3.5"
  }
}

 

git

由於開發項目的時候,常常由於一些莫名其妙的小錯卡住,文件多了也不知道在哪兒,才以爲多麼須要版本管理,小白來學下git好了…………

先跟着廖雪峯的程:建立版本庫  | bootcss的簡易指南 | Pro git文檔

git init

git add <filename>

git commit -m 「change」

git status 

git diff <filename>

git log | 顯示從最近到最遠的提交日誌

git log --pretty=oneline | commit id+comit單行顯示,不顯示日期

git reset --hard HEAD^ | 重要的版本回退來了~HEAD指向當前版本

git reset -hard commit_id | 而後到某固定版本(commit_id)

git reflog | 查看commit_id

git基本設置

  • 我的的用戶名稱和電子郵件地址修改,git 用於記錄是誰提交了更新,以及更新人的聯繫方式。

$ git config --global user.name "Donly Chan"

$ git config --global user.email donly@example.com
  • 自動高亮(頗有用的顏色提示,因有些人不喜歡,因此默認是不開啓的)

$ git config --global color.ui auto
  • 查看配置
$ git config --list
  • git 查看當前分支
git branch -vv
  • git忽略文件權限:
$ git config core.filemode false
$ git config --list
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息