9.node.js Package Manager NPM

Source: Internet
Author: User

NPM is the official package management tool from node. js for publishing, propagating, and relying on control of node. JS Packages

Install Express ==>, a popular web development framework based on node. JS, that allows you to quickly build a full-featured website.

$ NPM Install Express

Release of the package to create a Package.json file that complies with the NPM specification

$ NPM Init

When you enter a command, a Package.json file is generated

Package Name: (byvoidmodule) Alanversion: (1.0.0) 0.0.1description: Wu Tao first npm Pack entry point: (index.js) Test command:git Repository:keywords:author: Wu Tao License: (ISC) about-to-write to g:\nodejs\byvoidmodule\package.json:{  "name": "Alan ",  " version ":" 0.0.1 ",  " description ":" Wu Tao first npm package ",  " main ":" Index.js ",  " scripts ": {    " test ":" echo \ "Error:no test specified\" && exit 1 "  },  " author ":" Wu Tao ",  " license ":" ISC "}

This generates a Package.json file in the Byvoidmodule directory that complies with the NPM specification. Create a index.js as the interface of the package, a simple package is finished. Before the release, we also need to obtain an account for future maintenance of their own packages, using NPM AddUser according to the prompts to enter the user name, password, mailbox, waiting for account creation to complete. When you're done, you can use the NPM WhoAmI quiz to see if you've got your account. Next, run NPM publish in the directory where the Package.json is located, and wait a few moments to complete the release. Open your browser and visit http://search.npmjs.org/to find the package you just released. Now we can install it using the NPM install Byvoidmodule command on any computer in the world.

9.node.js Package Manager NPM

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.