Use ES6 ex/import in node.js
If want to do ES6 ex/im manner, set “type” in package.json as “module”:
module and module.exports point to a same imported object
Http Modul
Simple Use:

Publish an NPM Package
1. Create a folder with 3 files: package.json, README.md, index.js:

2. Init package.json with 6 key-values:
- name should be unique
- main, the entry of the package
- search key words on npm

3. Write code, export exported part in index.js:


4. Publish package on NPM
1. Create NPM account
2. Login NPM account on the terminal using npm login
