update
Update to the latest versions on the npm registry.
Options
Section titled “Options”--check
Section titled “--check”List outdated dependencies instead of updating them and exit with a status code of 1 if updates are found.
syncpack update --check
--config <file-path>
Section titled “--config ”syncpack
searches the monorepo root directory for a config file which follows its naming convention, but this can be overridden by providing a path to a specific configuration file instead.
The only requirement is that the file must have a file extension and that it is one of .cjs
, .cts
, .js
, .json
, .mjs
, .mts
, .ts
, .yaml
, or .yml
.
syncpack update --config ./config/syncpack.json
--dependencies <dependency-name-pattern>
Section titled “--dependencies ”Include dependencies whose name matches the given glob pattern.
To exclude, put a !
at the start of your query.
# Exact match for "react"
syncpack update --dependencies 'react'
# Substring match for "react"
syncpack update --dependencies '**react**'
# All dependencies under the AWS SDK scope
syncpack update --dependencies '@aws-sdk/**'
# Exact match for "react" or "webpack" (2 approaches)
syncpack update --dependencies 'react' --dependencies 'webpack'
syncpack update --dependencies '{react,webpack}'
# Substring match for "react" or "webpack" (2 approaches)
syncpack update --dependencies '**react**' --dependencies '**webpack**'
syncpack update --dependencies '**{react,webpack}**'
--dependency-types <comma-separated-dependency-type-names>
Section titled “--dependency-types ”Include dependencies of the given dependency types and/or custom types.
To exclude, put a !
at the start of your query.
# devDependencies only
syncpack update --dependency-types dev
# dependencies and devDependencies only
syncpack update --dependency-types dev,prod
# everything except peerDependencies
syncpack update --dependency-types '!peer'
--dry-run
Section titled “--dry-run”Cause syncpack to behave identically as when applying fixes, but never writing to disk.
syncpack update --dry-run
--log-levels <comma-separated-log-level-names>
Section titled “--log-levels ”Control how detailed the log output should be
Level | What is written to this channel |
---|---|
info | The standard output which forms syncpack's UI, including lint issues |
warn | Possible mistakes in your setup, or highlights of known gaps in syncpack |
error | Fatal exceptions or errors outside the normal running of syncpack |
debug | Extremely verbose detail on why syncpack assigns each status code |
# Turn off logging completely
syncpack update --log-levels off
# Only show verbose debugging logs
syncpack update --log-levels debug
# Show everything
syncpack update --log-levels error,warn,info,debug
--no-ansi
Section titled “--no-ansi”Syncpack will print colours and clickable hyperlinks to the terminal using ANSI escape code unless this option is set.
syncpack update --no-ansi
--source <file-pattern>
Section titled “--source ”Only run syncpack update
on package.json files matching the provided pattern(s).
Syncpack will look in the following places for glob patterns matching package.json files, in this order of precedence, and stop looking when a match is found:
- If
--source
CLI options are provided, use those. - If
source
is defined in configuration, use that. - If using npm workspaces or Yarn workspaces, read
workspaces
from./package.json
. - If using pnpm, read
packages
from./pnpm-workspace.yaml
. - If using Lerna, read
packages
from./lerna.json
. - Default to
'package.json'
and'packages/*/package.json'
.
# only the root package
syncpack update --source 'package.json'
# only packages matching a glob
syncpack update --source 'packages/beta-*'
# multiple values can be provided
syncpack update --source 'package.json' --source 'packages/beta-*'
--specifier-types <comma-separated-specifier-type-names>
Section titled “--specifier-types ”Include only instances whose version specifiers are of the given specifier types.
To exclude, put a !
at the start of your query.
# Exact versions only
syncpack update --show instances --specifier-types exact
# Missing or unsupported versions
syncpack update --show instances --specifier-types missing,unsupported
# Latest or workspace protocol only
syncpack update --show instances --specifier-types latest,workspace-protocol
--target <greediness>
Section titled “--target ”Limit updates to only those within the given semver portion.
# Accept any update in latest (x.x.x)
syncpack update --target latest
# Only update minor versions (1.x.x)
syncpack update --target minor
# Only update patch versions (1.2.x)
syncpack update --target patch
--help
Section titled “--help”Display a list of CLI options and other help information.
# Display a short summary of commands and options
syncpack update -h
# Display full help with examples
syncpack update --help