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

Exploring Node.js Modules

Modules and packages are the building blocks for breaking down your application into smaller pieces. A module encapsulates some functionality, primarily JavaScript functions, while hiding implementation details and exposing an API for the module. Modules can be distributed by third parties and installed for use by our modules. An installed module is called a package. 

The npm package repository is a huge library of modules that's available for all Node.js developers to use. Within that library are hundreds of thousands of packages you can be used to accelerate the development of your application.

Since modules and packages are the building blocks of your application, understanding how they work is vital to your success with Node.js. By the end of this chapter, you will have a solid grounding in both CommonJS and ES6 modules, how to structure the modules in an application, how to manage dependencies on third-party packages, and how to publish your own packages.

In this chapter, we will cover the following topics:

  • Definitions of all types of Node.js modules and how to structure both simple and complex modules
  • Using CommonJS and ES2015/ES6 modules and when to use each
  • Understanding how Node.js finds modules and installed packages, so you can better structure your application
  • Using the npm package management system (and Yarn) to manage application dependencies, to publish packages, and to record administrative scripts for the project

So, let's get on with it.

主站蜘蛛池模板: 南昌市| 肇东市| 牙克石市| 菏泽市| 云浮市| 阆中市| 改则县| 乌拉特后旗| 富民县| 阳东县| 昌乐县| 泰宁县| 望奎县| 亚东县| 内乡县| 司法| 米脂县| 固始县| 达拉特旗| 丰都县| 平谷区| 年辖:市辖区| 新平| 莲花县| 邛崃市| 昌宁县| 汽车| 丹凤县| 都昌县| 壤塘县| 礼泉县| 连南| 大同县| 乌兰察布市| 涟水县| 闽侯县| 揭西县| 商丘市| 莱芜市| 南雄市| 长沙市|