DEV Community

Cover image for Day 78/100 Npm Vs Yarn
Rio Cantre
Rio Cantre

Posted on • Originally published at dev.to

Day 78/100 Npm Vs Yarn

Tackling the details more deeply towards topics often neglected the difference between their functions and primary purpose. Somehow, reviewing minor information would make it more understandable and easy to remember.

v2

Here are the difference between the usage of each commands :

  • Install dependencies from package.json:
npm install == yarn
Enter fullscreen mode Exit fullscreen mode
  • Install a package and add to package.json:
npm install package --save == yarn add package
Enter fullscreen mode Exit fullscreen mode
  • Install a devDependency to package.json:
npm install package --save-dev == yarn add package --dev
Enter fullscreen mode Exit fullscreen mode
  • Upgrade a package to its latest version:
npm update --save == yarn upgrade
Enter fullscreen mode Exit fullscreen mode
  • Install a package globally:  
npm install package -g == yarn global add package
Enter fullscreen mode Exit fullscreen mode
  • Remove a dependency from package.json:
npm uninstall package --save == yarn remove package
Enter fullscreen mode Exit fullscreen mode

Extensions to consider

These are some extensions which I think would be helpful to make your coding more interactive.

Code snippet

npx cowsay hello

Ok to proceed? (y) y
 _______
< hello >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
Enter fullscreen mode Exit fullscreen mode

Stay in touch with me along with my coding journey. Don't hesitate to reach out and let's venture together!

Twitter

Medium

Dev.to

Oldest comments (0)