javascript - What are npm, bower, gulp, Yeoman, and grunt good for? - Stack Overflow

I'm a backend developer, and slightly confused by npm, bower, gulp, grunt, and Yeoman. Whenever I

I'm a backend developer, and slightly confused by npm, bower, gulp, grunt, and Yeoman. Whenever I ask someone what their purpose is, the answer tends to boil down to dependency manager - for all of them. Surely, we don't need four different tools that all do the same?

Can someone please explain what each of these is good for in as few sentences as possible - if possible just one per tool, using language a five year old (with development skills) could understand?

For example:

  • SVN stores, manages, and keeps track of changes to our source code

I have used maven, Jenkins, nexus and ant in the past; maybe you could compare the tools above to these?

Also feel free to add other front-end tools to the list.

Here is what I have found out so far - not sure it's correct, though:

  • bower dependency manager for front-end development/JS libraries, uses a flat dependency list
  • npm dependency manager for node.js server, can resolve transitive dependencies/dependency trees
  • grunt runs tasks, much like Jenkins, but locality on the command line
  • Yeoman provided scaffolding, i.e skeleton projects
  • gulp same as grunt, but written in js only
  • node.js server for js apps?
  • git decentralized SCM/VCS, counterpart to svn/cvs

Am I close? :)

I'm a backend developer, and slightly confused by npm, bower, gulp, grunt, and Yeoman. Whenever I ask someone what their purpose is, the answer tends to boil down to dependency manager - for all of them. Surely, we don't need four different tools that all do the same?

Can someone please explain what each of these is good for in as few sentences as possible - if possible just one per tool, using language a five year old (with development skills) could understand?

For example:

  • SVN stores, manages, and keeps track of changes to our source code

I have used maven, Jenkins, nexus and ant in the past; maybe you could compare the tools above to these?

Also feel free to add other front-end tools to the list.

Here is what I have found out so far - not sure it's correct, though:

  • bower dependency manager for front-end development/JS libraries, uses a flat dependency list
  • npm dependency manager for node.js server, can resolve transitive dependencies/dependency trees
  • grunt runs tasks, much like Jenkins, but locality on the command line
  • Yeoman provided scaffolding, i.e skeleton projects
  • gulp same as grunt, but written in js only
  • node.js server for js apps?
  • git decentralized SCM/VCS, counterpart to svn/cvs

Am I close? :)

Share Improve this question asked Apr 22, 2016 at 8:28 ChristianChristian 6,42014 gold badges56 silver badges111 bronze badges 1
  • This is very good question. I thought many peoples like me is geek developer and want to join the web development game in 2017. – Cheung Commented Apr 6, 2017 at 6:33
Add a comment  | 

4 Answers 4

Reset to default 50

You are close! Welcome to JavaScript :)

Let me give you a short description and one feature that most developers spend some time with.

bower Focuses on packages that are used in the browser. Each bower install <packagename> points to exactly one file to be included for (more can be downloaded). Due to the success of webpack, browserify and babel it's mostly obsolete as a first class dependency manager.

2018 Update: bower is mostly deprecated in favour of NPM

npm Historically focuses on NodeJS code but has overthrown bower for browser modules. Don't let anyone fool you: NPM is huge. NPM also loads MANY files into your project and a fresh npm install is always a good reason to brew a new cup of coffee. NPM is easy to use but can break your app when changing environments due to the loose way of referencing versions and the arbitrariness of module publishing. Research Shrink Wrap and npm install --save-exact

2018 Update: NPM grew up! Lot's of improvements regarding safety and reproducibility have been implemented.

grunt Facilitates task automation. Gulps older and somewhat more sluggish brother. The JavaScript community used to hang out with him in 2014 a lot. Grunt is already considered legacy in some places but there is still a great amount of really powerful automation to be found. Configuration can be a nightmare for larger use-cases. There is a grunt module for that though.

2018 Update: grunt is mostly obsolete. Easy to write webpack configurations have killed it.

gulp Does the same thing as grunt but is faster.

npm run-script You might not need task runners at all. NodeJS scripts are really easy to write so most use-cases allow for customizedtask-automation workflow. Run scripts from the context of your package.json file using npm run-script

webpack Don't miss out on webpack. Especially if you feel lost on the many ways of writing JavaScript into coherent modular code. Webpack packages .js files into modules and does so splendidly. Webpack is highly extensible and offers a good development environment too: webpack-dev-server Use in conjunction with babel for the best possible JavaScript experience to date.

Yeoman Scaffolding. Extremly valuable for teams with different backgrounds as it provides a controllable common ground for your projects architecture. There even is a scaffolding for scaffolds.

So, Since you have a good idea what each is, I will give you a simple workflow.

  1. I use yeoman to scaffold a basic skeleton.
  2. I am using node as the runtime for my application. ie. run node appname
  3. I use npm to install node modules for helping me write the application in node
  4. I might need some component from bower like front-end libraries so use bower to fetch these.
  5. Now to do some repetitive task I will use grunt or gulp to write some tasks. So everytime I want to repeat it, say minimify my js files I call grunt/gulp and make them do it. Difference you ask, Gulp is stream based while grunt is task based.
  6. I do version control using git to keep track of changes
  1. Gulp vs Grunt: Gulp provides more flexibility with task automation, Grunt comes built in with a lot of functionality as per the common development practices. There are two main differences between Grunt and Gulp:

    • Grunt focuses on configuration, while Gulp focuses on code
    • Grunt was built around a set of built-in, and commonly used tasks, while Gulp came around with the idea of enforcing nothing, but how community-developed micro-tasks should connect to each other Read here

  1. NodeJS: It is a Non-blocking server-side scripting language. Which means operations won't block further execution until current operation finishes.

  1. Git: As you mentioned it is an SCM tool, a widely used one. As per the GitHub docs it is different from other SCM tools as data is never deleted.

    Git thinks of its data more like a set of snapshots of a mini filesystem. Every time you commit, or save the state of your project in Git, it basically takes a picture of what all your files look like at that moment and stores a reference to that snapshot.

    When you do actions in Git, nearly all of them only add data to the Git database. It is very difficult to get the system to do anything that is not undoable or to make it erase data in any way. As in any VCS, you can lose or mess up changes you haven’t committed yet; but after you commit a snapshot into Git, it is very difficult to lose, especially if you regularly push your database to another repository.

    Read More


  1. Bower vs NPM : Bower and NPM are dependency managers but Bower modules are for front-end development. NPM is a huge collection of modules to be used with NodeJS backend. This SO answer covers it better

I added some details:

npm is a package manager for javascript, npm is nodejs's package ecosystem, but it can be used only for front-end projects.

grunt & gulp are useful to separate and automate tasks like minification, compilation, unit testing on command line, it's a way lighter solution than (for example) visual studio as the process is only a separated (and usually lightweight) command line/process.

Regarding the differences between gulp, grunt and bower there is already a ticket: What are the differences between Grunt, Gulp.js and Bower? Why & when to use them?

Nodejs is more a javascript runtime. Node.js allows the creation of web servers and networking tools using js and a collection of "modules" that handle various core functionality and other core functions. Source

This ticket resumes the differences between Git and Subversion: Why is Git better than Subversion?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1737320880a3936314.html

相关推荐

  • 为什么 Angular 没有引入 Vue 的 virtual DOM?

    Angular 里没有虚拟 DOM 的概念。Angular采用的是一套独特的变更检测机制,其工作模型与虚拟 DOM 的思想完全不同。Angular利用 Zone.js 捕捉异步任务的执行情况,通过脏检测系统追踪数据状态的变化,并直接对真实

    2小时前
    00
  • 【赵渝强老师】TiDB的配置文件

    TiDB集群的配置文件主要包括:TiKV、TiDB、PD和TIFlash的配置文件,执行下面的命令可以查看到所有相关的配置文件。代码语言:powershell复制# tree tidb-deploy{tidb*,pd*,tikv*,ti

    1小时前
    00
  • Samsung:揭秘SSD单盘扩容的 IU 方案

    全文概览NAND闪存技术的物理限制以及DRAM成本的考量,使得SSD架构设计面临严峻挑战。如何在有限的DRAM资源下,实现更大容量、更高性能和更长寿命的SSD,成为业界关注的焦点。本文深入探讨了在存储开发者大会(SDC24)上,Samsun

    1小时前
    00
  • 聊聊Spring AI Alibaba的BilibiliDocumentReader

    序本文主要研究一下Spring AI Alibaba的BilibiliDocumentReaderBilibiliDocumentReadercommunitydocument-readersspring-ai-alibaba-star

    1小时前
    00
  • 从沟通压力到智能助手:5 分钟上手构建公益 AI 问答系统

    摘要公益项目经常面临沟通负担重、响应不及时的问题。本文通过一个可运行的 Demo,手把手教你用 LangChain 和 RAG 架构搭建一个 AI 聊天助手,让它来帮你自动回答常见问题、对接知识库,大幅提升沟通效率。引言很多公益组织团队不大

    1小时前
    00
  • OFC 2025:AI高速互连技术报告(Nvidia)

    (该报告是今年OFC上OIF光互连论坛的开场报告,其实也没有太多新的信息,偏科普性质,简单收集一下)一、引言在人工智能(AI)技术蓬勃发展的当下,计算能力的提升对数据传输和连接技术提出了极高要求。高速、高效、低功耗的互连与连接技术成为支撑A

    59分钟前
    00
  • Linux|Linux日常高频使用的100条命令,强烈建议收藏!

    @七禾页话,15年12月在泰国出差做了半宿的车去Ko-Chang也就是象岛的时候,船上看了一场海上日出,鸭蛋黄的太阳从东方冉冉升起,海面上平静的没有风浪学习永无止境,记录相伴相随!—— 琉璃康康作为ICT从业人员,Linux是日常频繁需要

    56分钟前
    00
  • 心心念念的前端代码生成利器,前后端一网打尽

    分享一个轻量级前后端分离接私活利器renren-security,对于做外单不失是一个好的选择。虽然项目开源的功能比不上企业版的,但是学习基本框架后,在用于企业后台系统开发;也是毫无压力的。项目特点友好的代码结构及注释,便于阅读及二次开发实

    52分钟前
    00
  • 万能的前向声明碰到他竟然不行了

    您好,我是昊天,国内某头部音频公司的C++主程,多年的音视频开发经验,熟悉Qt、FFmpeg、OpenGL。如果你对这些感兴趣,欢迎关注我的公众号最近遇到一个问题,可简化如下:汽车类存在一个引擎实例,由于汽车内只有一个引擎且不涉及共享所有权

    47分钟前
    00
  • k8s中sidecar死循环

    序言sidecar产生的问题1 背景在k8s的环境中,pod的使用越来越多了,也就产生了sidecar容器,在现在的环境中,一个pod可以带差不多快10个sidecar容器了,各种各样的场景,例如监控的sidecar容器,例

    46分钟前
    00
  • 如何模拟浏览器行为获取网页中的隐藏表单数据?

    一、隐藏表单数据的背景与挑战网页表单是用户与网站交互的重要方式之一。当用户填写并提交表单时,浏览器会将表单数据发送到服务器。然而,有些表单数据可能被隐藏起来,例如:动态生成的隐藏字段:某些表单中可能包含一些隐藏字段,其值是通过 JavaSc

    20分钟前
    00
  • 【IntelliJ 】IntelliJ IDEA 2017激活码

    CNEKJPQZEX-eyJsaWNlbnNlSWQiOiJDTkVLSlBRWkVYIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpb

    18分钟前
    00
  • C++: 类和对象(中)

    类的默认成员函数构造函数 定义代码语言:javascript代码运行次数:0运行复制#include<iostream>using namespace std;class Date{public:void Init(in

    15分钟前
    00
  • ​​​​​48days强训——day12

    第一题:删除公共字符链接: 描述输入两个字符串,从第一字符串中删除第二个字符串中所有的字符。例如,输入”They are students.”和”aeiou”,则删除之后的第一个字符串变成”Thy r stdnts.”输入描述:每个测试输入

    14分钟前
    00
  • 【Git#1】初识 git(配置 &amp; 基本认识 &amp; 文件操作)

    一、前言在工作或学习时经常遇到这样的情况:我们在编写各种文档时,为了防止文档丢失,更改失误,失误后能恢复到原来的版本,不得不复制出一个副本,比如:“报告-v1”“报告-v2”“报告-v3”“报告-确定版”“报告-最终版” 每个版本有各自的内

    9分钟前
    00
  • 【MySQL】表的操作

    在数据库中,一起皆是表,可以说表是数据库最重要的组成部分.后续的sql语句也大多数就是对表进行操作.1.创建表语法:代码语言:javascript代码运行次数:0运行复制CREATE TABLE 表名(属性名1 属性类型属性名2

    8分钟前
    00
  • 【文件操作与IO】详细解析文件操作与IO (一)

    一. 什么是文件1. 认识文件先来认识狭义上的文件(file)。针对硬盘这种持久化存储的IO设备,当我们想要进行数据保存时,往往不是保存成一个整体,而是独立成一个个的单位进行保存,这个独立的单位就被抽象成文件的概念,就类似办公桌上的一份份

    5分钟前
    00
  • 超详细的OpenManus本地部署+免费调用DeepSeek的API(Windows系统)

    Manus做为全球首款AI Agent&#xff0c;相信大家都想体验一下&#xff0c;但是邀请码太难获得&#xff0c;还好有OpenManus&#xff0c;我们可以本地部署&#xff0c;一样

    3分钟前
    00
  • 智谱AI大模型免费开放:开启AI创作新时代

    文章摘要:近日,国内领先的人工智能公司智谱AI宣布旗下多款大模型服务免费开放,这一举措标志着大模型技术正式迈入普惠阶段。本文将详细介绍智谱AI此次开放的GLM-4 等大模型,涵盖其主要功能、技术特点、使用步骤以及应用场景,帮助广大开发者和

    46秒前
    00

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信