GradleΒ vsΒ npm

Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Gradle
Gradle

3K
2.1K
+ 1
242
npm
npm

18.5K
13.9K
+ 1
1.6K
Add tool

Gradle vs npm: What are the differences?

Developers describe Gradle as "A powerful build system for the JVM". Gradle is a build tool with a focus on build automation and support for multi-language development. If you are building, testing, publishing, and deploying software on any platform, Gradle offers a flexible model that can support the entire development lifecycle from compiling and packaging code to publishing web sites. On the other hand, npm is detailed as "The package manager for JavaScript". npm is the command-line interface to the npm ecosystem. It is battle-tested, surprisingly flexible, and used by hundreds of thousands of JavaScript developers every day.

Gradle and npm are primarily classified as "Java Build" and "Front End Package Manager" tools respectively.

"Flexibility" is the primary reason why developers consider Gradle over the competitors, whereas "Best package management system for javascript" was stated as the key factor in picking npm.

Gradle and npm are both open source tools. npm with 17.2K GitHub stars and 3.17K forks on GitHub appears to be more popular than Gradle with 9.16K GitHub stars and 2.67K GitHub forks.

reddit, Instacart, and Starbucks are some of the popular companies that use npm, whereas Gradle is used by Lyft, PedidosYa, and Third Iron. npm has a broader approval, being mentioned in 2605 company stacks & 2586 developers stacks; compared to Gradle, which is listed in 456 company stacks and 351 developer stacks.

What is Gradle?

Gradle is a build tool with a focus on build automation and support for multi-language development. If you are building, testing, publishing, and deploying software on any platform, Gradle offers a flexible model that can support the entire development lifecycle from compiling and packaging code to publishing web sites.

What is npm?

npm is the command-line interface to the npm ecosystem. It is battle-tested, surprisingly flexible, and used by hundreds of thousands of JavaScript developers every day.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose Gradle?
Why do developers choose npm?

Sign up to add, upvote and see more prosMake informed product decisions

Jobs that mention Gradle and npm as a desired skillset
FOSSAFOSSA
San Francisco, CA
What companies use Gradle?
What companies use npm?

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Gradle?
What tools integrate with npm?

Sign up to get full access to all the tool integrationsMake informed product decisions

What are some alternatives to Gradle and npm?
Apache Ant
Ant is a Java-based build tool. In theory, it is kind of like Make, without Make's wrinkles and with the full portability of pure Java code.
Jenkins
In a nutshell Jenkins CI is the leading open-source continuous integration server. Built with Java, it provides over 300 plugins to support building and testing virtually any project.
Groovy
Groovy builds upon the strengths of Java but has additional power features inspired by languages like Python, Ruby and Smalltalk. It makes modern programming features available to Java developers with almost-zero learning curve.
Apache Maven
Maven allows a project to build using its project object model (POM) and a set of plugins that are shared by all projects using Maven, providing a uniform build system. Once you familiarize yourself with how one Maven project builds you automatically know how all Maven projects build saving you immense amounts of time when trying to navigate many projects.
Bazel
Bazel is a build tool that builds code quickly and reliably. It is used to build the majority of Google's software, and thus it has been designed to handle build problems present in Google's development environment.
See all alternatives
Decisions about Gradle and npm
Tim Abbott
Tim Abbott
Founder at Zulip Β· | 3 upvotes Β· 6.9K views
atZulipZulip
Node.js
Node.js
npm
npm
Yarn
Yarn

I have mixed feelings on the Yarn/npm/Node.js ecosystem. We use it for Zulip, because you basically have to in order to have a modern JavaScript toolchain. And I like that Yarn lets us pin dependency versions out of the box for predictability in our production releases; we have to do significant work for the Python version of this feature.

But one also deals with broken third-party dependencies uploaded to npm way too often (even ignoring the malicious packages issues that have gotten a lot of press of late). And one mostly has to use nvm in order to pin a specific version of node itself in a maintainable way, and nvm is a mess.

See more
Russel Werner
Russel Werner
Lead Engineer at StackShare Β· | 5 upvotes Β· 6.2K views
atStackShareStackShare
npm
npm
Yarn
Yarn

We use Yarn because at the time we decided to adopt it, npm had some missing features and issues. We like the speed and determinism provided by Yarn. We could probably use npm at this point, but we have no real reason to switch from Yarn. If you have a convincing argument to switch from npm to Yarn please leave a comment on this decision!

See more
Johnny Bell
Johnny Bell
Senior Software Engineer at StackShare Β· | 17 upvotes Β· 68.3K views
ESLint
ESLint
Prettier
Prettier
Babel
Babel
npm
npm
Yarn
Yarn
Node.js
Node.js
Webpack
Webpack
#ES5
#ES6

So when starting a new project you generally have your go to tools to get your site up and running locally, and some scripts to build out a production version of your site. Create React App is great for that, however for my projects I feel as though there is to much bloat in Create React App and if I use it, then I'm tied to React, which I love but if I want to switch it up to Vue or something I want that flexibility.

So to start everything up and running I clone my personal Webpack boilerplate - This is still in Webpack 3, and does need some updating but gets the job done for now. So given the name of the repo you may have guessed that yes I am using Webpack as my bundler I use Webpack because it is so powerful, and even though it has a steep learning curve once you get it, its amazing.

The next thing I do is make sure my machine has Node.js configured and the right version installed then run Yarn. I decided to use Yarn because when I was building out this project npm had some shortcomings such as no .lock file. I could probably move from Yarn to npm but I don't really see any point really.

I use Babel to transpile all of my #ES6 to #ES5 so the browser can read it, I love Babel and to be honest haven't looked up any other transpilers because Babel is amazing.

Finally when developing I have Prettier setup to make sure all my code is clean and uniform across all my JS files, and ESLint to make sure I catch any errors or code that could be optimized.

I'm really happy with this stack for my local env setup, and I'll probably stick with it for a while.

See more
Gradle
Gradle
Apache Maven
Apache Maven

We use Apache Maven because it is a standard. Gradle is very good alternative, but Gradle doesn't provide any advantage for our project. Gradle is slower (without running daemon), need more resources and a learning curve is quite big. Our project can not use a great flexibility of Gradle. On the other hand, Maven is well-know tool integrated in many IDEs, Dockers and so on.

See more
Mark Nelissen
Mark Nelissen
CTO at Gemsotec bvba Β· | 4 upvotes Β· 2.9K views
Yarn
Yarn
TypeScript
TypeScript
React
React
npm
npm

I use npm because I also mainly use React and TypeScript. Since several typings (from DefinitelyTyped) depend on the React typings, Yarn tends to mess up which leads to duplicate libraries present (different versions of the same type definition), which hinders the Typescript compiler. Npm always resolves to a single version per transitive dependency. At least that's my experience with both.

See more
Jason Barry
Jason Barry
Cofounder at FeaturePeek Β· | 4 upvotes Β· 8.8K views
atFeaturePeekFeaturePeek
npm
npm
Yarn
Yarn
Babel
Babel
Sublime Text
Sublime Text
JavaScript
JavaScript
React
React
TypeScript
TypeScript
Flow (JS)
Flow (JS)
#Frontend

I think our #Frontend stack is pretty standard – but we have taken some deviations from a typical modern stack:

  • Flow (JS) instead of TypeScript. Flow was an easy choice 2+ years ago, as both flow and React were (and still are) maintained by Facebook. Today, it seems that the JavaScript community has settled on TypeScript as the winner. For new projects, I'd choose TS, but I don't see the point in migrating an existing project from flowtype to TS, when the end result will be roughly the same. Sure, memory usage is a bit high, and every now and then I have to kill some zombie processes, but our text editors (Sublime Text), CI scripts, and Babel are already set up to take advantage of the type safety that flow offers. When/if the React team writes React itself in TS, then I'll take a closer look – until then, flow works for us.

  • Yarn instead of npm. When yarn debuted, we never looked back. Now npm has pretty much caught up with speed and lockfiles, but yarn gives me confidence that my dependency installs are deterministic. Really interested in the plug-n-play (PnP) feature that removes the need for a node_modules folder, but haven't implemented this yet.

See more
Yarn
Yarn
npm
npm
Node.js
Node.js

From a StackShare Community member: β€œI’m a freelance web developer (I mostly use Node.js) and for future projects I’m debating between npm or Yarn as my default package manager. I’m a minimalist so I hate installing software if I don’t need to- in this case that would be Yarn. For those who made the switch from npm to Yarn, what benefits have you noticed? For those who stuck with npm, are you happy you with it?"

See more
Interest over time
Reviews of Gradle and npm
No reviews found
How developers use Gradle and npm
Avatar of lispur
lispur uses npmnpm

Utilize npm private module to package shared library for different React / React Native clients. Shareable code goes here. Basically deliver Redux Store with Firebase integration and business logic in a library. Each React app utilizes this while delivering a device/target specific UI.

Avatar of Giovanni Candido da Silva
Giovanni Candido da Silva uses GradleGradle

The main build tool. Integrate and delegate build to NodeJS in the client application, and build the server, its used for development productivity and production optimisations and quality. Automate all machine scripts and build things from dev to continuous integration to production

Avatar of Refractal
Refractal uses npmnpm

If you're using Node or Gulp, you can't help but use NPM in some form or another. Fortunately that's never a bad thing with the massive package repository and glowing ecosystem making it a breeze to work with.

Avatar of Cirrus Labs
Cirrus Labs uses GradleGradle

All 20+ micro-services that power Cirrus CI are living in a single mono repository. Gradle is using for testing and building Docker containers for all services.

Avatar of Oomba
Oomba uses npmnpm

We manages all of our packages, including Angular JS through npm. It is a very quick way of downloading / installing packages into your project.

Avatar of Kang Hyeon Ku
Kang Hyeon Ku uses GradleGradle

maven κ³Ό ν•¨κ»˜ μžλ°”μ˜ 유λͺ…ν•œ λΉŒλ“œ νˆ΄μ€‘ ν•˜λ‚˜μΈλ° μ†”μ§νžˆ κ·Έλƒ₯ ν…ŒμŠ€ν¬ λŸ¬λ„ˆλΌλŠ” 생각이 λ“ λ‹€. ssh ν”ŒλŸ¬κ·ΈμΈμ„ μ“°λ©΄ κ°„λ‹¨ν•œ λ°°ν¬λŠ” μ‰½κ²Œ μžλ™ν™” ν•  수 μžˆλ‹€. ssh ν”ŒλŸ¬κ·ΈμΈμ˜ 경우 μ„œλ²„ μ‹œμž‘ μ’…λ£Œ μ‰˜μ΄ 잘 μ•ˆλ˜λŠ” κ²½μš°κ°€ μžˆλŠ” 것 κ°™λ‹€.

Avatar of Thibault Maekelbergh
Thibault Maekelbergh uses npmnpm

Module is published as bpost on the npm registry. Tasks for the module are also defined as npm run tasks with commit hooks for git

Avatar of Andrew Gatenby
Andrew Gatenby uses npmnpm

It's the front-end version of Composer, so is pretty essential to pull in packages that can be tracked and kept up to date.

Avatar of Refractal
Refractal uses GradleGradle

Gradle is used generally as our Android build tool, simplifying dependencies and general build process dramatically.

Avatar of claudiofus
claudiofus uses GradleGradle

Accelerate developer productivity. Gradle helps teams build, automate and deliver better software, faster.

How much does Gradle cost?
How much does npm cost?
Pricing unavailable
Pricing unavailable