我们新建文件,index.js
console.log('服务端启动成功!')
const a=10
exports.a=a
把文件进行导出,之后新建文件index1.js
const a=require('./index')
console.log(a.a)
之后引入,并且打印文件
运行 node index1.js
服务端启动成功!
10
这就是基本node的程序编写,试试运行使用趴.
我们新建文件,index.js
console.log('服务端启动成功!')
const a=10
exports.a=a
把文件进行导出,之后新建文件index1.js
const a=require('./index')
console.log(a.a)
之后引入,并且打印文件
运行 node index1.js
服务端启动成功!
10
这就是基本node的程序编写,试试运行使用趴.