By Yijun
In this blog, you learn about the Module Repository feature of Node.js Performance Platform, which is developed on top of cnpm. You also will learn how you can publish a private package using Module Repository.
Due to Internet restrictions in China, developers cannot install the official npm warehouse very quickly or easily. To mitigate this issue, Alibaba provides the complete image warehouse cnpm to allow developers in China to replace npm with cnpm. The source code of the cnpm image warehouse is open to the public. Many enterprises that need to publish and install private modules have started to use cnpm to build their own private image warehouses.
Node.js Performance Platform is also developed on top of cnpm. Node.js Performance Platform provides developers with a private warehouse free of charge, specifically the Module Repository. The purpose of this feature is to simplify the Node.js development environment, giving developers more time to focus more on the business aspects of development. This can all be done through the Module Repository and through also combining the underlying performance monitoring, upper-layer application frameworks together. (For these specific purposes, Egg.js is recommended.)
Compared with the private warehouses many enterprises build by using the open-source version of cnpm, the Module Repository has the following advantages:
In addition to covering all features of private cnpm warehouses, Module Repository in Node.js Performance Platform also supports the separation of multiple users and fine-grained access controls to meet several different enterprise development scenarios.
Currently, Module Repository is available free of charge, allowing you to take advantage of all of these advanced features.
This tutorial shows how you can publish a private package using Module Repository in Node.js Performance Platform.
To do it, follow the steps given here:
When you access the Module Repository homepage for the first time, you first need to create a Registry, which will serve as your private warehouse. Click Create a Registry in the upper-right corner to create a private Module Repository.
After the Registry is created, you can see the address of the private warehouse:
Use the npm/cnpm command shown in the figure to direct the npm/cnpm client warehouse to this private module warehouse, and then perform the logon operation. The account information required for the npm/cnpm client login command can be found in My Information:
Next, click Create a Scope in the upper-right section of the Module Repository homepage to create a Scope under this private warehouse by business, department, function, or any other factor that you want:
After the Scope is created, publish a private module with the corresponding package name into this Scope. For example, a Scope named @cloud is created in this example. You can run the npm publish command to publish the package named @cloud/quickstart to this Scope.
The preceding section shows a simple example in which only one person uses the Module Repository. However, in actual development scenarios, it is inevitable that many people need to develop and maintain private modules in a collaborative manner. Module Repository in Node.js Performance Platform also provides complete support for collaborative development. For more information about the collaborative development with Module Repository, see Module Repository User Guide.
Node.js Application Troubleshooting Manual - Outline and General Problem Metrics
vangie - January 23, 2019
Alex - August 16, 2018
Alibaba Clouder - January 4, 2019
Alibaba Clouder - August 18, 2020
Alibaba Clouder - April 17, 2018
Alibaba Clouder - November 1, 2018
Explore Web Hosting solutions that can power your personal website or empower your online business.
Learn MoreA low-code development platform to make work easier
Learn MoreExplore how our Web Hosting solutions help small and medium sized companies power their websites and online businesses.
Learn MoreHelp enterprises build high-quality, stable mobile apps
Learn MoreMore Posts by hyj1991