Hacker News new | ask | show | jobs
by mwpmaybe 3385 days ago
> For package management, I think npm is on par with bundler

NPM is non-deterministic and doesn't have lockfiles, so it's a bit of a stretch to say it's on par with Bundler.

Yarn solves both those problems for JavaScript projects, and it's much faster.

1 comments

Right, you have add on npm-shrinkwrap if you want to lock everything down (which I do use for some projects).

Yarn may well be better than npm, in fact, as far as I can tell it is, but, frankly, npm works well and I'm tired of switching js dependencies, especially really core dependencies like a package manager.

I'm hoping npm just steals whatever yarn does better than it so that I never need to switch...

Bundler is pretty great.

pip... pip... I don't know what to say about pip. It's probably my fault, but I can never seem to get pip to fully understand that what I put in requirements.txt should always always always be used for the project no matter what system level libraries are installed. If yarn were available for python, I'd switch to it today...

> Yarn may well be better than npm, in fact, as far as I can tell it is, but, frankly, npm works well and I'm tired of switching js dependencies, especially really core dependencies like a package manager...

Yarn still uses your package.json. I think it will definitely win out over directly using npm since it is better in a couple of ways and, from a user perspective, is just a thin wrapper around the things you're already used to doing. Ways my workflow has changed:

npm install . -> yarn

npm save --dev pkg -> yarn add --dev pkg

npm save pkg -> yarn add pkg

npm run command -> yarn run command

If you start using it and dislike it, just npm uninstall -g yarn, rm the yarn.lock file and bam, you've still got a normal npm dependency management setup.

> If yarn were available for python, I'd switch to it today

Project worth keeping your eye on: https://github.com/kennethreitz/pipenv/blob/master/README.rs...