Skip to content

Remove Dependencies

Easily remove dependencies from all packages in your monorepo with a single command.

Usage

This command allows you to remove dependencies from all packages in the monorepo at once.

bash
monopkg remove <package-name...>
bash
bun x monopkg remove <package-name...>
bash
npx monopkg remove <package-name...>
bash
yarn dlx monopkg remove <package-name...>

Options

  • -f, --filter <packages...> - Include specific packages.
  • -e, --exclude <packages...> - Exclude specific packages.
  • -w, --workspace <workspaces...> - Root workspaces of the packages.

Examples

Remove a Single Dependency

Remove lodash from all packages in the monorepo:

bash
monopkg remove lodash
bash
bun x monopkg remove lodash
bash
npx monopkg remove lodash
bash
yarn dlx monopkg remove lodash

Remove Multiple Dependencies from Specific Packages

Remove lodash and typescript from package-a and package-b:

bash
monopkg remove lodash typescript -f package-a package-b
bash
bun x monopkg remove lodash typescript -f package-a package-b
bash
npx monopkg remove lodash typescript -f package-a package-b
bash
yarn dlx monopkg remove lodash typescript -f package-a package-b

Remove a Dependency from a Specific Workspace

Remove lodash from all packages in the apps workspace:

bash
monopkg remove lodash -w apps
bash
bun x monopkg remove lodash -w apps
bash
npx monopkg remove lodash -w apps
bash
yarn dlx monopkg remove lodash -w apps

Released under the MIT License.