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
相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息