DEV Community

Discussion on: You, me and package.json

Collapse
 
sqlrob profile image
Robert Myers

Thank you, a nice concise, useful article that's going to help me with my node work.

Something you didn't really touch on, but when would you use yarn vs npm on a new project? I always use what a project was created with, and npm for anything I create, but when should I use yarn for my own projects?

Collapse
 
xabadu profile image
Fernando Larrañaga

Thanks, Robert! Glad to hear the article was helpful :)

On yarn vs npm, while initially there were noticeable differences in performance and features, I guess at this time is more of a personal preference and what works best with your setup, since you can get pretty much the same with both.

I've seen a lot of projects adding lock files for both, which to be honest, seems like a bit of pain to maintain and could potentially lead to having those files off sync regarding the correct versions of dependencies, but it's definitely a possibility.

In general, I'd say, if you're publicly sharing your project, npm would be a more appropriate way to go, since it's the one that most devs, especially beginners, are most familiar with.