Node.js笔记

来源:互联网 发布:数据导入excel表格 编辑:程序博客网 时间:2024/05/16 10:38

一个模块想要对外暴露变量(函数也是变量),可以用module.exports = variable;,一个模块要引用其他模块暴露的变量,用var ref = require('module_name');就拿到了引用模块的变量。

模块输出两种方式,最好直接只记住第二种

module.exports = {    hello: hello,    greet: greet};
exports.hello = hello;exports.greet = greet;

箭头函数(匿名函数) 用=>

看到koa入门

原创粉丝点击