CLI tool to install the peerDependencies of your direct direct, development, optional or peer dependencies. It will search the package.json
of your project for these said dependency types, and then check the package.json
s of your installed dependencies for listed peerDependencies.
These peerDependencies can then be installed via npm/yarn/pnpm
whichever package manager is preferred, is used to initially install the project.
This tool should be used on projects that are installed.
When a peerDependency is referenced by several of your dependencies, only the newest version or version range will be installed.
Installation Instructions
Global installation instructions:
npm i -g @emahuni/trans-peerdeps
Local installation instructions (use whatever preferred package manager npm
/ yarn
/ pnpm
) where examples are given:
yarn -D @emahuni/trans-peerdeps
Usage
Execute the following in the working directory of your project:
for global installation:
trans-peerdeps
for local installation:
yarn trans-peerdeps
Prerequesities
Before executing ensure, that you have installed the dependencies in the project.
Options
-
--cwd
: Working directory, of where the tool should look for a package.json and checks for peerDependencies of your dependencies -
Dependency types (you can use more than one option):
-
--own-deps
: install direct dependencies peers -
--dev-deps
: install development dependencies peers -
--opt-deps
: install optional dependencies peers -
--peer-deps
: install peer dependencies peers - If none of these options are provided, it will default to
--own-deps
&--dev-deps
-
-
--depFilter
: regex pattern to process only peerDependencies of dependencies matching the pattern -
--peerDepFilter
: regex pattern to install only peerDependencies matching the pattern -
--dryRun
: skip the install step. -
--force
: install peerDependencies regardless if they are already part of your package.json and therefore already installed. -
Any argument used with
npm install
/yarn add
/pnpm install
(ex.--save-dev
,--no-save
,--save
, ...)