
nodejs
司机大傻
可视化发烧友
展开
-
【node.js学习】--(2)--模块
一个文件就是一个模块exports公开接口创建exports.jsvar i; exports.set = function(num){//设置值 i=num; console.log("seti to "+i); } exports.square = function(){//求平方并输出 i=Math.pow(i,2);原创 2015-02-28 16:43:44 · 2021 阅读 · 0 评论 -
【node.js学习】--(1)--HelloWord
官网http://nodejs.org/download/ 下载windows7 64位下载msi安装包:http://nodejs.org/dist/v0.12.0/x64/node-v0.12.0-x64.msi安装到F盘F:\nodejs 安装目录中新建hello.jsconsole.log("hello world!");进入安装目录执行nodehello.js,运行之后效果如下: 新建h原创 2015-02-28 00:17:08 · 3171 阅读 · 3 评论 -
【node.js学习】--(3)--读写文件
读写文件一般读写新建copyFile.jsvar fs = require("fs"); function copyFile(src,dest){ varfile = fs.readFileSync(src);//根据文件路劲读取文件 fs.writeFileSync(dest,file);//将内容写入文件 } function main(原创 2015-02-28 20:30:10 · 2012 阅读 · 0 评论 -
【node.js学习】--(4)--Express4.x框架
Express是Nodejs标准的web开发框架 参考http://blog.fens.me/nodejs-express4/安装项目构建器先安装 npminstall -g express 再安装npm install -gexpress-generator #全局安装-g检查安装结果 express -V# 检查express的版本卸载(需要时使用)npm uninstall-g expr原创 2015-02-28 23:55:27 · 2993 阅读 · 0 评论 -
【node.js学习】--(5)--Bower
使用bower安装依赖NPM是Node.js PackageManager 的意思,bower是twitter的又一个开源项目,使用nodejs开发,用于web包管理。安装bower npm install bower -g 参考http://blog.fens.me/nodejs-bower-intro/检查cache:bower缓存管理help:显示Bower命令的帮助信息home:通过浏览器原创 2015-03-03 22:01:24 · 3650 阅读 · 0 评论 -
【node.js学习】--(7)--安装Mongodb
下载和安装mongodb下载mongodb 官网http://www.mongodb.org/下载mongodb-win32-x86_64-2008plus-ssl-3.0.0-signed,msi 小知识:查看系统是多少位wmic os get osarchitecture安装http://docs.mongodb.org/manual/tutorial/install-mongodb-on-w原创 2015-03-07 22:54:31 · 4539 阅读 · 0 评论 -
【node.js学习】--(6)--Bootstrap
使用Bootstrap使用中文网的CDN源加载bootstrap :修改F:\nodejs\nodejs-bower\views\index.ejs This is a simple hero unit, a simple jumbotron-style componentfor calling extra attention to featured原创 2015-03-03 22:04:04 · 2637 阅读 · 0 评论