Nodejs Study notes-NPM Introduction

Source: Internet
Author: User

Https://docs.npmjs.com/README.html

This is Npmjs's official website, for a certain English-based friends, reading such a raw document, will certainly benefit.


1. What is NPM?

NPM is the abbreviation for Node Package Manager, which is the bundle management tool for node. js. NPM makes it easier for JS developers to share and reuse code, and NPM can automatically update the code as other developers need to reuse it in their own applications.


These reusable code is called packages, sometimes called moudles. The package is actually a folder with one or more files, which also contains a file called "Package.json" (containing some metadata related to this file). For example, a Web site is composed of more than 10 or hundreds of packages, of course, these packages are usually very small.


There are three common usage scenarios for NPM:

(1), allowing users to download third-party packages written by others from the NPM server to local use

(2), allow users to download and install from the NPM Server command-line programs written by others to local use

(3), allowing users to upload their own packages or command-line programs to the NPM server for others to use


2. Update NPM

NPM is also installed with node installed, but NPM is updated more frequently than node, so to make sure it's the latest version, we can do this:

NPM install [email protected]-G

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/89/E5/wKioL1ghRLKC7WAcAAB74Foaoho554.png "title=" Qq20161108112105.png "alt=" Wkiol1ghrlkc7wacaab74foaoho554.png "/>


The whole process takes about 3 minutes, open My computer into the C drive--users--administrator.minserever--appdata can see automatically added several folders

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/89/E5/wKioL1ghRP_gvsdWAAAuCazj9co556.png "title=" Qq20161108112217.png "alt=" Wkiol1ghrp_gvsdwaaaucazj9co556.png "/>


command line input Node-v to view node version

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/89/E9/wKiom1ghRayiK6ScAAAUwsj1wXk783.png "title=" Qq20161108112515.png "alt=" Wkiom1ghrayik6scaaauwsj1wxk783.png "/>


(Follow up to continue to learn, continue to update ...)


Nodejs Study notes-NPM Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.