Best yarn Commands to use for being productive
YARN stands for “Yet Another Resource Negotiator“. It was introduced in Hadoop 2.0 to remove the bottleneck on Job Tracker which was present in Hadoop 1.0. YARN was described as a “Redesigned Resource Manager” at the time of its launching, but it has now evolved to be known as large-scale distributed operating system used for Big Data processing. In this article, we will discuss Some popular yarn commands to use for being a productive software developer. Let’s discuss it one by one.
YARN Install Command –
Installs a package in the package.json file in the local node_modules folder.
YARN add Command –
Specifying the package name with yarn add can install that package, and that can be used in our project. Yarn add also takes parameters that can be used to even specify the package’s version (specific) to be installed in the current project being developed.
yarn add <package name...>
yarn add lodash
We can also use to install lodash globally as follows.
yarn global add lodash
YARN Remove Command –
Remove the package given as a parameter from your direct dependencies updating your package.json and yarn.lock files in the process. Suppose you have a package installed lodash you can remove it using the following command.
yarn remove <package name...>
yarn remove lodash
YARN AutoClean command –
This command is used to free up space from dependencies by removing unnecessary files or folders from there.
yarn autoclean <parameters...>
yarn autoclean --force
YARN Install command –
Install all the dependencies listed within package.json in the local node_modules folder. This command is somewhat
yarn install <parameters ....>
Suppose we have developed a project and pushed in Github then we are cloning it on our machine, so what we can do is perform yarn install to install all of the required dependencies for the project and we can do this with the following command in the terminal
YARN help command –
This command when used gives out a variety of commands that are available to be used with yarn.
yarn help <parameters...>
This command helps us with option available with a short description of each of the commands.
Please Login to comment...