官术网_书友最值得收藏!

Summary

In this chapter, we explored in depth what modules are, why they are useful, and why we need a module system. We also learned about the history of modules in JavaScript and about the two module systems available today in Node.js, namely CommonJS and ESM. We also explored some common patterns that are useful when creating modules or when using third-party modules.

You should now be comfortable with understanding and writing code that takes advantage of the features of both CommonJS and ESM.

In the rest of the book, we will rely mostly on ES modules, but you should now be equipped to be flexible with your choices and be able to deal with CommonJS effectively if necessary.

In the next chapter, we will start to explore the idea of asynchronous programming with JavaScript, and we will examine callbacks, events, and their patterns in depth.

主站蜘蛛池模板: 峨边| 鄱阳县| 柳州市| 白银市| 云和县| 蓬莱市| 余干县| 昌黎县| 雷山县| 满洲里市| 无棣县| 太谷县| 泗阳县| 永兴县| 青铜峡市| 香河县| 义马市| 客服| 诸城市| 汨罗市| 红原县| 新田县| 灌云县| 祁阳县| 九龙县| 靖州| 新晃| 开平市| 吴桥县| 宝坻区| 大姚县| 和硕县| 句容市| 井冈山市| 平潭县| 手游| 和田市| 讷河市| 吉隆县| 简阳市| 清远市|