Gradle vs npm: What are the differences?
Gradle and npm are primarily classified as "Java Build" and "Front End Package Manager" tools respectively.
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?
What is npm?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
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.
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!
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.
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.
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.
I think our #Frontend stack is pretty standard – but we have taken some deviations from a typical modern stack:
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.
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?"
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.
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
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.
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.
We manages all of our packages, including Angular JS through npm. It is a very quick way of downloading / installing packages into your project.
maven 과 함께 자바의 유명한 빌드 툴중 하나인데 솔직히 그냥 테스크 러너라는 생각이 든다. ssh 플러그인을 쓰면 간단한 배포는 쉽게 자동화 할 수 있다. ssh 플러그인의 경우 서버 시작 종료 쉘이 잘 안되는 경우가 있는 것 같다.
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
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.
Gradle is used generally as our Android build tool, simplifying dependencies and general build process dramatically.