nodejs 加载模块
来源:互联网 发布:动态文字特效制作软件 编辑:程序博客网 时间:2024/05/09 18:51
function hello(){var name;this.setName = function(n){name = n;}this.sayHello = function(){console.log('Hello ' + name); }}module.exports = hello;
加载的是类型
var hello = require('./hello');var h = new hello();h.setName('xiuye');h.sayHello();
var a = {a:1,b:2,c:3};module.exports = a;
加载的是对象实例
xiuye@ubuntu:~/workspace$ nodejs> require("./test");{ a: 1, b: 2, c: 3 }> a = require("./test");{ a: 1, b: 2, c: 3 }> a{ a: 1, b: 2, c: 3 }> a.a1> a.b2
0 0
- nodejs模块加载机制
- nodejs 加载模块
- nodejs 模块加载机制
- NodeJs模块加载机制
- nodejs 的模块加载
- nodejs的模块加载小结
- nodejs模块加载的猜想
- nodejs 动态加载模块 _compile
- nodeJS基础--模块加载机制
- nodeJs模块的理解以及加载方式
- nodejs中如何创建和加载模块
- es6模块加载 nodejs(common.js)模块加载 amd模块加载的区别整理
- nodejs 加载模块时,路径中的前缀“@”表示什么意思?
- Nodejs 模块
- nodejs模块
- Nodejs 模块
- nodejs-模块
- NodeJS-模块
- 图示经典算法--插入排序
- 《MySQL学习笔记》:ORDER BY的使用
- fopen函数使用基础
- Linux性能分析的前60000毫秒
- 数据结构基本概念整理
- nodejs 加载模块
- Java虚拟机学习之内存区域与内存溢出
- ORACLE中行转列之wm_concat() 和 LISTAGG()
- 【UVA11806】Cheerleaders——容斥
- javascript中的undefined和null
- [leetcode] 138. Copy List with Random Pointer
- ER模型详解-陈氏模型
- 关于pch头文件
- IOS开发之结构体的使用