nodeJS笔记

待解决:

exports和module.exports区别

exports对外暴露单个函数,module.exports对外暴露一个类(类里有很多函数)

exports的使用

exports.[name1] = [name1]

exports.[name2] = [name2]

mudule.exports的使用

第一种返回多个函数方式:module.exports = {name1.name2} (我没试过)

第二种返回一个类的方式:

nodemon的使用

nodemon : 无法加载文件 C:\Program Files\nodejs\node_global\nodemon.ps1,因为在此系统上禁止运行脚本。

win+x,管理员方式启动PowerShell

输入:  set-executionpolicy remotesigned

Y

即可

原文地址:https://www.cnblogs.com/hcl6/p/15743627.html