The difference between NPM and Bower

Source: Internet
Author: User

NPM and Bower

1 NPM is a package manager that accompanies node. js, which initially supports only node. JS module Management, now supports JavaScript Package Manager, front-end Universal

2 Bower is a package manager designed for front-end performance, all for the front-end consideration

Difference:

NPM: Supports nested dependency management, resulting in a folder called "Node_modules"

Bower: Only support flat dependencies, nested dependencies, solved by the program itself

Usage in development:

Bower Management front-end packages

NPM manages back-end packages and build tools such as Yeoman,grunt,gulp,jshint, etc.

But now almost all use NPM to download Management Pack files and back-end module management, not with Bower

NPM-Generated Package.json

Package.json is a dependency package that manages NPM

After executing NPM init, the files that appear

The setup step for NPM is to go to the next node. js file and go to Npm-v

NPM Download Plugin, more multifunctional Baidu go

1 NPM init//build Package.json file

2 npm Install jquery--save--dev//Build devdependencies dependencies in Pckage.json

3 npm Install jquery--save//Build dependencies dependencies in Package.json, so when uploading git, you don't have to upload "node_modules" files.

4 NPM Install jquery//Do not write, default ibid.

5 NPM Install or NPM install--save-dev//upload git or company repository, you can delete NPM's "Node_modules" folder, clone the code, then execute the command, according to the configuration in Package.json Depends on the download plugin

The difference between NPM and Bower

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.