Visitar URL original
socket optimize

socket optimize

Optimize dependencies with @socketregistry overrides

socket optimize replaces dependencies that have a Socket registry alternative with the matching @socketregistry package. It updates package.json with npm: aliases such as npm:@socketregistry/<name>@^1, then runs your package manager's install to update the lockfile.

  • In a private package or a project with workspaces, the overrides go in overrides for npm, pnpm.overrides for pnpm, and resolutions for Yarn and Bun. Other packages get both overrides and resolutions. vlt is not supported.
  • The project needs a package.json and a lockfile.
  • By default each override uses a caret range on the major version. --pin uses the exact latest version.
  • --prod is not supported for Yarn Berry or Bun.

socket optimize --help

$ socket optimize --help

  Optimize dependencies with @socketregistry overrides

  Usage
    $ socket optimize [options] [CWD=.]

  API Token Requirements
    - Quota: 100 units
    - Permissions: packages:list

  Options
    --pin               Pin overrides to latest version
    --prod              Add overrides for production dependencies only

  Examples
    $ socket optimize
    $ socket optimize ./path/to/project --pin

Did this page help you?