init

add a package

run install

npm install => yarn

In case you havn’t caught on the previous examples had aformat of [npm command] => [yarn command] where npm command is the command for the desired outcome using npm and [yarn command] was the command for the desired outcome using Yarn.

yarn add lodash

Now since I did this in a project that had packages already it added a yarn.lock that is almost 2700 lines long so I wont be posting it here. The yarn.lock file should describe to other computers how to install the same packages and what versions so that all people working on the same project have the same experience. What this means is you shouldn’t be telling some one “it works on my machine”.

Run a Script

If you read the last few posts yo umay be wondering if switching to Yarn means having to stop using npm scripts. In a word: nope.

That’s right to run scripts with Yarn it’s just yarn run [script name]

And everything runs just fine and there should be less surprises as the project moves from machine to machine.

And Also

The logo is a kitten, I mean come on you have to like that.

Conclusion

So far Yarn seems like a good idea. I’m sure there are things that I’m missing but if it holds keeps most of it’s ideals in place I might want to add the dist folder to my .gitignore since build results should be less questionable with more consistent environment setup for the build. Sound crazy? Leave a comment below or sending an email to me at brett@wipdeveloper.com and let me know.