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

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.

主站蜘蛛池模板: 威信县| 广水市| 西乌| 曲周县| 盘山县| 安庆市| 灵川县| 五家渠市| 双城市| 孙吴县| 临安市| 辽宁省| 利辛县| 故城县| 开阳县| 铜川市| 吐鲁番市| 陇川县| 页游| 房山区| 桂平市| 莱阳市| 大连市| 紫云| 丰原市| 建始县| 三原县| 诸暨市| 会理县| 嘉兴市| 中山市| 台北市| 辽阳县| 曲麻莱县| 滕州市| 双牌县| 丹棱县| 黄大仙区| 固阳县| 阜新市| 长丰县|