# node_learn **Repository Path**: null_435_7166/node_learn ## Basic Information - **Project Name**: node_learn - **Description**: 学习node - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-06-01 - **Last Updated**: 2023-06-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # node_learn #### 介绍 学习node # 一、 commonjs 导入导出 ``` // commonjs 导出对象 module.exports = { PI: 3.14, max:(a,b)=>{return a>b?a:b}, min:(a,b)=>{return a{return a+b;} } // ES6 具名导出对象 let a=1000,b=2000,c=3000; export {a, b} let d = 4000; export {d} // ES6 匿名导入 import myutil from "./utils/index.js" console.log(myutil); // ES6 具名导入 import {a, b, d} from "./utils/index.js" console.log(a, b, d); ``` # 三、nodemon热更新 - 更改代码之后不需要每次都重启 - npm install nodemon - "dev": "nodemon ./src/main.js" - 使用nodemon以后终端并不会结束 主动结束 ctrl+c