ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
### module.exports ``` module.exports将接口暴露给外部使用 ``` ~~~ //对象可以和其他对象、方法以及属性一起被export出来 function MyClass() { } MyClass.prototype = { hello: function () { return 'hello m1'; }, say: function () { return 'say m1'; } }; var myClass = new MyClass(); module.exports = myClass; ~~~ ~~~ //对外导出多个对象、方法和值 exports.hello = function () { return 'hello m2'; }; exports.say = function () { return "say m2"; }; ~~~