Nodejs notes
来源:互联网 发布:mysql emoji 截断 编辑:程序博客网 时间:2024/06/06 20:13
Require
When require is given a path of a folder, nodejs will look for index.js file in that folder. If index.js exists, nodejs uses it. Otherwise it causes an error.
Module.exports and require
module.exports
is used to export a module, which exposes methods and properties as interfaces to be called. require
is to import a module. Principly, module.exports
and require
work as below:
module.exports = { greet: function () { return 0; }}require = function (filepath) { // interpret the file and return the assigned module.exports ... return module.exports;}
阅读全文
0 0
- Nodejs notes
- notes-nodejs
- Notes
- notes
- Notes
- notes
- notes
- notes
- notes
- Notes
- notes
- Notes
- notes
- Notes
- notes
- Notes
- Notes
- Notes
- ubuntu下允许root用户ssh远程登录
- struts2核心工作原理
- Retrofit源码解析-动态代理
- Ubuntu14.04+ROS Indigo+SVO(Semi-direct Visual Odometry)
- Android EditText控制小数点位数及输入限制工具类
- Nodejs notes
- Retrofit 源码剖析-深入
- BZOJ 刷题开始
- 508. Most Frequent Subtree Sum
- Java技术汇总
- 异常解决 java.lang.UnsupportedOperationException: Required method destroyItem was not overridden
- DAO层,Service层,Controller层、View层
- 【51Nod】1181 质数中的质数(质数筛法)
- 好用的排序函数-qsort解析及代码程序示例