The difference between NPM and Bower

Source: Internet
Author: User

NPM and Bower are functionally coincident, but not mutually exclusive, and can be used simultaneously in the project. The difference is that NPM adopted a nested dependency tree at the beginning of the design. A common front-end package has a long dependency tree, and NPM will download the development environment together and not share the dependency code with other installation packages. resulting in a very great number of files, this way is obviously unfriendly to the front end, not suitable for front-end code deployment. Bower uses a flat dependency management approach, bower only download the post-compilation pre-module, using more in line with the use of front-end development habits.

NPM belongs to the manager of the node module. While Bower is the front-end module management, NPM is primarily used for the internal dependency management of node. JS projects, and the installed modules are located in the Node_modules folder under the project root directory. While Bower is used for front-end development in most cases, dependency management on content such as css/js/templates can be customized for the dependent download directory structure.

In a real-world project, we can use NPM management-dependent packages on the backend, using a combination of bower management-dependent packages in the front-end. While the front-end common development language, the different end of the development engineer can better use the tools on hand to improve development efficiency.

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.