npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@juit/check-updates

v3.0.9

Published

Small and fast utility to update package dependencies

Downloads

519

Readme

Dependencies Update Checker

This package contains a simple script to update the dependencies of a given package file (or files).

By default it will extend the semantics of semver checking for minor version updates for tilde ranges (~x.y.z) and checking for major version updates for caret ranges (^x.y.z).

To adhere to the standard semver rules simply specify the --strict option.

When installed, the check-updates script can be invoked directly:

$ check-updates --help

Usage:
  check-updates [--options ...] [package.json ...]

Options:
  -h, --help           Show this help.

  -v, --version        Show the version and exit.

  -b, --bump           Bump the version of the  package file when changes in the
                       dependencies are found. Specifiy either "major",  "minor"
                       or "patch" (default) to indicate which version to bump.

  -s, --strict         Strictly  adhere to semver  rules for  tilde (~x.y.z) and
                       caret (^x.y.z) dependency ranges.

  -q, --quick          Consider dev/peer/optional dependency updates if and only
                       if the main depenencies also had updates.

  -d, --debug          Output debugging informations.

  -x, --dry-run        Do not write package changes.

      --no-errors      Exit with 0 in case  of no updates.  Normally the updater
                       will exit with 255 in this case.

      --no-workspaces  Do not process workspaces.

      --no-align       Do not align workspaces versions. By default all versions
                       will  be set to  the highest  one amongst  all workspaces
                       after bumping.

Remarks:
  Multiple package.json files can be  specified on the command line.  In case no
  files are specified,  the default is to process  the package.json  file in the
  current directory.

$

Alternatively it can be invoked via npx '@juit/check-updates'.

By default (unless --no-errors is specified) the exit code returned to the caller will be:

  • 0: dependencies were updated and package.json was changed.
  • 255: nothing was updated, no changes.
  • any other: error from NodeJS.

Options

--bump (or -b)

Bump the major, minor or patch revision level if changes were detected.

By default no versions will be bumped, and when the --bump version is specified without any argument, the patch version will be bumped.

--strict (or -s)

By default, version ranges specified by ~ (tilde: match on patch version) or ^ (caret: match patch or minor versions) will be extended so that ~ will behave like ^ and match both patch and minor versions, while ^ will match any version above the one specified.

The --strict flag makes the updater work with the strict definition of ~ or ^ ranges. See here for more informations on range specifiers.

--quick (or -q)

By specifying the --quick flags, the updater will process the main dependencies first and only if any changes were detected then the other dependencies in devDependencies, peerDependencies and optionalDependencies will be processed.

--dry-run (or -x)

Only process and display changes without writing the updated package.json files.

--debug (or -d)

Dump out lots of debugging informations while updating packages.

--no-errors

By default the updater will exit with 255 if no changes were detected in the dependencies. Specifying --no-errors will make the updater exit with 0 unless a real error happened.

The 255 exit code is useful in scripts to detect whether changes were not detected. For example the following script will exit with zero if no changes were detected, will fail if an error occurred, and will perform some tasks if changes were detected:

#!/bin/bash

set -e # exit on errors
npx '@juit/check-updates' --quick --bump || exit $(( $? == 255 ? 0 : $? ))
# ... do stuff when changes were detected

--no-workspaces

By default the updater will recursively process workspaces defined in the various package.json files. The --no-workspaces flag disables this.

--no-align

By default, when workspaces are present, versions will be aligned to the greates versions amongst all workspaces after (if specified) bumping. When --no-align is specified,

Legal