bower<\/a> to make the job easier. (As far as functionality is concerned, it works same as npm, if you have used.) <\/p>\nSteps for installations are just for linux guys – windows people – DIY.<\/p>\n
First you need to install npm `sudo apt-get install npm`
\nYou can install it by `sudo npm install -g bower`<\/p>\n
Once you have installed bower, You can install a web package, just by executing following command in the directory of project –<\/p>\n
`bower install jquery`<\/p>\n
You can even use your own git repository as source or any other url <\/p>\n
`bower install https:\/\/github.com\/jquery\/jquery.git#2.0.3`<\/p>\n
Above command will install jquery for your project.<\/p>\n
Once you have installed it successfully things will be kept in
\n`bower_components\/jquery`
\n you can refer it by
\n`bower_components\/jquery\/dist\/jquery.js`. Simple. That’t it ?<\/p>\n
No.<\/p>\n
if you are like me – possessive about your directory structure – You want everything inside something like `assets\/lib\/jquery\/dist\/jquery.js`, or simply want it inside `assets\/lib` directory instead of too many file\/directory in root. <\/p>\n
You can create a file in root of project `.bowerrc`, put following content inside the file
\n`{
\n “directory” : “assets\/lib”
\n}
\n`<\/p>\n
Since filename begins with `.` it will be hidden in file browsers, clean.<\/p>\n
Again – do you find these long assets path annoying ? – `Grunt` to rescue – check http:\/\/bower.io\/docs\/tools\/#grunt <\/p>\n","protected":false},"excerpt":{"rendered":"
If you are web developer it becomes hard to manage all js libraries if you aren’t using any package manager. Few folks created bower to make the job easier. (As far as functionality is concerned, it works same as npm, if you have used.) Steps for installations are just for linux guys – windows people … <\/p>\n
Continue reading<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[13,8],"tags":[15,14,16],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-javascript","category-snippets","tag-bower","tag-grunt","tag-web","item-wrap"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pciGs2-19","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":7,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":78,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/71\/revisions\/78"}],"wp:attachment":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}