2- Add the following code:
exports.myText = 'this is a test'
3- Save changes
4- Create a file called module-demo.js
5- Add the following code:
var mDemo = import('.\my-module.js) console.log(mDemo.myText)
6- Execute in console:
node .\module-demo.js
7- Console output will be
this is a test
No comments:
Post a Comment