摘要:
person.js module.exports = function(){ this.name = "person"; this.sleep = function(){ console.log("sleep in the night"); } this.eat = function(){ cons 阅读全文
摘要:
经典继承 借用构造函数,子类型构造函数内部调用超类型构造函数 function SuperType(){ this.colors = ["red","blue","green"]; } function SubType(){ SuperType.call(this); //继承了SuperType 阅读全文
摘要:
原生模块调用 var httpModule = require('http'); //require http 模块 文件模块调用 var test = require('./test.js'); exports 和module.exports 只有exports和module.exports对象暴 阅读全文
摘要:
node.js hello world /** *Node.js base server */ var http = require('http'); http.createServer(function(req,res){ res.writeHead(200,{'Content-Type','te 阅读全文
摘要:
1.下载node.js安装 http://nodejs.org 2.添加环境变量c:\Program Files\nodejs\node.exe 到path环境变量中 3.输入node-v 查看是否安装成功 linux 配置 1.下载node.js for linux 源码安装包 2.解压tar - 阅读全文