yarn
2016-11-03
Today I learnt about Yarn.
Yarn is a node package manager, built by facebook, inspired by cargo and bundler!
It is meant to address the shortcomings of npm, such as module download failures and inconsistant state.
Like bundler, it creates a lockfile in the root of the project called yarn.lock
This lockfile ensures that each build of your project is reproducable, on CI servers and colleagues’ machines.
Great. So now what?
Yarn is super simple to use.
It’s effectively a drop in replacement for npm.
Installation
|
|
Add export PATH="$PATH:$HOME/.yarn/bin"
to your bash profile.
Usage
To add a dependency to your package, you simply run:
|
|
To make your dependency available globally
|
|
Where it shines
“Why do I have this dependency in my node_modules folder?”, I hear you ask!
Yarn can actually tell you!!!
Wanna inspect the licenses of your dependencies? Sure!
|
|
Interesting read
For more usage info
npm vs yarn
Why I’m Working on Yarn, by Yehuda Katz