2016-10-16 23:24:40 +01:00
|
|
|
# yarn
|
|
|
|
|
|
|
|
> JavaScript and Node.js package manager alternative.
|
2019-01-30 11:19:23 +00:00
|
|
|
> Homepage: <https://yarnpkg.com>.
|
2016-10-16 23:24:40 +01:00
|
|
|
|
|
|
|
- Install a module globally:
|
|
|
|
|
|
|
|
`yarn global add {{module_name}}`
|
|
|
|
|
2018-11-27 17:33:36 +00:00
|
|
|
- Install all dependencies referenced in the `package.json` file (the `install` is optional):
|
2016-10-16 23:24:40 +01:00
|
|
|
|
2018-11-27 17:33:36 +00:00
|
|
|
`yarn install`
|
2016-10-16 23:24:40 +01:00
|
|
|
|
2018-11-27 17:33:36 +00:00
|
|
|
- Install a module and save it as a dependency to the `package.json` file (add `--dev` to save as a dev dependency):
|
2016-10-16 23:24:40 +01:00
|
|
|
|
|
|
|
`yarn add {{module_name}}@{{version}}`
|
|
|
|
|
2018-11-27 17:33:36 +00:00
|
|
|
- Uninstall a module and remove it from the `package.json` file:
|
2016-10-16 23:24:40 +01:00
|
|
|
|
|
|
|
`yarn remove {{module_name}}`
|
|
|
|
|
2018-11-27 17:33:36 +00:00
|
|
|
- Interactively create a `package.json` file:
|
2016-10-16 23:24:40 +01:00
|
|
|
|
|
|
|
`yarn init`
|
|
|
|
|
2016-10-17 04:10:01 +01:00
|
|
|
- Identify whether a module is a dependency and list other modules that depend upon it:
|
2016-10-16 23:24:40 +01:00
|
|
|
|
|
|
|
`yarn why {{module_name}}`
|