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