Npm difference bower and the Details

Abstract:  This article talking about the difference between the bower and npm detailed description, simply put, is npm back-end development, module installation tool, and bower, is the front-end module installation tool. For example, when installing express, socket.io, of course, using the NPM, then such bootstrap, jquery front-end frame and the like, need bowe

 

Simply put, npm is the back-end development , the module installation tool, and bower, is the front-end module installation tool.
For example, when installing express, socket.io, of course, using the NPM, then such bootstrap, jquery front-end frame and the like, need bower

Front-end technology and engineering practice is really rapid ah, I remember when, I do this semi-amateur Hangchihangchi the front page of time, how can there be so many things can ah, I have now advanced to fully read the. This article mainly to talk about is the difference with the package manager bower and npm of.
Stackoverflow is largely in view of the translation part of his understanding.

npm is accompanied by a package manager Node.js occur, most can only start module management support Node.js, but later, after the first revision npm official website, the slogan is, javascript package manager, so it has not is limited to
Node.js module management, and has been common to all js package management tools, and can say, before and after the take-up.

bower, then, from the outset, is designed specifically for front-end performance package manager, everything all front-end considerations. The biggest difference between npm and bower, is the npm support nested dependency management, and bower only support flat-dependent (nested dependent by
solving the programmer).

Nesting dependence refers to, you rely on software packages, as well as its own dependencies, like grapes, pick a long list. In the server environment, when it did anything, because storage space is large enough, all code is run locally, as long as you resolve depend on the line,
but to the users of the product browser, it is a problem, you can not let the user to download several M js code, it would be too bad. In this case, you need a programmer to manually resolve nested dependencies used in libraries. For example, to ensure that a wide variety of plug-ins
rely on the same version of jQuery.

Why are there a lot of projects bower and npm have to use it, it is because the use bower package management front-end, but with npm to manage some of the back-end packages and build tools, for example, yeoman, grunt, gulp, jshint so much more.

All package manager, has its own drawbacks, depending on their need to use the most appropriate projects.

Key is to say in the end what kind of relationship and differences between NPM and Twitter launched called Bower's package manager do? (Bower's official website wrote, Bower is "A package manager for the web", it says it is not a thing NPM).

In fact, in the actual project, NPM and Bower will be use inside. Bower and installation and upgrade all rely on NPM, the following command can be used to install global Bower

npm install -g bower
then you can use

bower install [#]
similar to NPM way related to the current management of the front-dependent project. NPM to use and as convenient.

Wherein, the biggest difference is that NPM, NPM mainly used Node.js internal dependencies management program, installed modules located file folder node_modules project root. The download directory structure for the most part Bower front-end development, dependency management for content CSS / JS / templates, dependency can be customized.

These are the contents of the small series of carefully prepared for you Yunqi community, in Yunqi community blog, Q & A, public numbers, characters, courses and other columns and some related content, please continue to use the Search button in the upper right corner to search front-end programmer the difference module, code, user bower npm difference between front-end development, npm and the bower, bower and npm What is the difference, bower and npm difference, npm bower, in order to obtain more knowledge to you.

(Original address: https: //yq.aliyun.com/ziliao/40449)

Published 429 original articles · won praise 410 · Views 9.2 million +

Guess you like

Origin blog.csdn.net/aerchi/article/details/104548425