I recently watched yarn crash course by Traversy Media on YouTube and though of listing all the commands in that video. lodash and nodemon packages are taken as examples. Enjoy 😃
Description | Command |
---|---|
Set config | $ yarn config set init-license MIT |
Get config | $ yarn config get init-license |
Delete config | $ yarn config delete init-license |
Install a package | $ yarn add lodash |
Remove installed package | $ yarn remove loadash |
Install a specific version of a package | $ yarn add lodash@4.17.3 |
Upgrade an existing outdated package | $ yarn upgrade lodash@4.17.5 |
Add a global package | $ yarn global add nodemon |
Check where yarn installs global stuff | $ yarn global bin |
Remove a global package | $ yarn global remove nodemon |
Get installed dependencies (dependencies of dependencies) | $ yarn list |
Get top most dependencies | $ yarn list - -depth=0 |
Get dependencies for specific package | $ yarn list —pattern gulp |
Install a dev dependency | $ yarn add gulp --dev |
Remove a dev dependency | $ yarn remove gulp |
Check versions of the package.json with yarn.lock | $ yarn check |
Generate a yarn.lock file from package.json | $ yarn import |
Run scripts | $ yarn run dev |
Check licenses of packages | $ yarn licenses list |
Create .tgz file of packages | $ yarn pack |
Check cache | $ yarn cache |
Check cache for a specific package | $ yarn cache list - -pattern lodash |
Clear yarn cache | $ yarn cache clean |