3.0.22 • Published 23 hours ago

npm-update-package v3.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
23 hours ago

npm version build lint test

npm-update-package

CLI tool for creating pull requests to update npm packages

Table of Contents

Requirements

  • Git
  • Node.js v18 or later
  • npm or Yarn

Supported platforms

  • GitHub
  • GitHub Enterprise

Usage

The simplest use of npm-update-package is just run the following command:

npx npm-update-package --github-token <github-token>

Alternatively, you can use a specific version as follows:

npx npm-update-package@1 --github-token <github-token>

Options

You can customize behavior via CLI options.
Some options can embed variables like {{packageName}}(HTML-escaped) or {{{packageName}}}(not HTML-escaped).

--additional-labels

Labels other than npm-update-package to add to pull request.

NameValue
typestring[]
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --additional-labels bot dependencies

--assignees

User names to assign to pull request.

NameValue
typestring[]
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --assignees alice bob

--assignees-sample-size

How many members to be assigned to assignees.

NameValue
typenumber
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --assignees alice bob \
  --assignees-sample-size 1

--commit-message

Commit message template.

NameValue
typestring
required-
defaultchore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}

Available variables:

VariableDescription
currentVersionCurrent package version
newVersionNew package version
packageNamePackage name
levelSemver level (major/minor/patch)
dependencyTypeDependency type (dependencies/devDependencies/peerDependencies/bundledDependencies/optionalDependencies)

Example:

npx npm-update-package \
  --github-token <github-token> \
  --commit-message "chore({{{dependencyType}}}): {{{level}}} update {{{packageName}}} from {{{currentVersion}}} to v{{{newVersion}}}"

--dependency-types

Dependency types to be updated.

NameValue
typestring[]
required-
defaultdependencies, devDependencies, peerDependencies, bundledDependencies, optionalDependencies

Allowed values:

ValueDescription
dependenciesdependencies
devDependenciesdevDependencies
peerDependenciespeerDependencies
bundledDependenciesbundledDependencies
optionalDependenciesoptionalDependencies

Example:

npx npm-update-package \
  --github-token <github-token> \
  --dependency-types dependencies devDependencies

--draft-pr

Whether to create pull request as draft.

NameValue
typeboolean
required-
defaultfalse

Example:

npx npm-update-package \
  --github-token <github-token> \
  --draft-pr true

--fetch-release-notes

Whether to fetch release notes.

NameValue
typeboolean
required-
defaulttrue

Example:

npx npm-update-package \
  --github-token <github-token> \
  --fetch-release-notes false

--fetch-sleep-time

Sleep time between fetching (ms).

NameValue
typenumber
required-
default1000

Example:

npx npm-update-package \
  --github-token <github-token> \
  --fetch-sleep-time 2000

--git-user-email

Git user email.

NameValue
typestring
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --git-user-email alice@example.com

--git-user-name

Git user name.

NameValue
typestring
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --git-user-name alice

--github-token

GitHub token.

NameValue
typestring
required✔️

--ignore-packages

Package names to ignore.

NameValue
typestring[]
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --ignore-packages @types/jest jest

--log-level

Log level to show.

NameValue
typestring
required-
defaultinfo

Allowed values:

ValueDescription
offDo not output any logs.
fatalOutput fatal logs.
errorOutput fatal/error logs.
warnOutput fatal/error/warn logs.
infoOutput fatal/error/warn/info logs.
debugOutput fatal/error/warn/info/debug logs.
traceOutput fatal/error/warn/info/debug/trace logs.

Example:

npx npm-update-package \
  --github-token <github-token> \
  --log-level debug

--outdated-pr-strategy

What to do when outdated pull requests exist.

NameValue
typestring
required-
defaultrecreate

Allowed values:

ValueDescription
createCreate new pull request.
recreateClose outdated pull requests and create new pull request.
skipSkip creating pull request.

Example:

npx npm-update-package \
  --github-token <github-token> \
  --outdated-pr-strategy create

--package-manager

Package manager of your project.
Since npm-update-package automatically determines which package manager to use, it is usually not necessary to use this option.

NameValue
typestring
required-

Allowed values:

ValueDescription
npmUse npm
yarnUse Yarn

Example:

npx npm-update-package \
  --github-token <github-token> \
  --package-manager yarn

--pr-body-github-host

GitHub host of pull request body.

NameValue
typestring
required-
defaulttogithub.com

Example:

npx npm-update-package \
  --github-token <github-token> \
  --pr-body-github-host "github.example"

--pr-body-notes

Additional notes for Pull request body.

NameValue
typestring
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --pr-body-notes "**:warning: Please see diff and release notes before merging.**"

--pr-title

Pull request title template.

NameValue
typestring
required-
defaultchore(deps): {{{level}}} update {{{packageName}}} to v{{{newVersion}}}

Available variables:

VariableDescription
currentVersionCurrent package version
newVersionNew package version
packageNamePackage name
levelSemver level (major/minor/patch)
dependencyTypeDependency type (dependencies/devDependencies/peerDependencies/bundledDependencies/optionalDependencies)

Example:

npx npm-update-package \
  --github-token <github-token> \
  --pr-title "chore({{{dependencyType}}}): {{{level}}} update {{{packageName}}} from {{{currentVersion}}} to v{{{newVersion}}}"

--reviewers

User names to request reviews.

NameValue
typestring[]
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --reviewers alice bob

--reviewers-sample-size

How many members to be assigned to reviewers.

NameValue
typenumber
required-

Example:

npx npm-update-package \
  --github-token <github-token> \
  --reviewers alice bob \
  --reviewers-sample-size 1

GitHub token

GitHub token is required to run npm-update-package.
Available tokens and permissions required for each token are as follows.

Features of each token are as follows.

GitHub ActionsGitHub AppPersonal access token
Owner of tokenGitHuborganization or useruser
Author of pull requestsgithub-actionsappuser
Trigger other actions-

We recommend using GitHub App for the following reasons.

  • When you use the token of GitHub Actions, the job will not trigger other actions.
  • Personal access token relies on personal account.
  • When you use the Personal access token, the author of pull requests will be the user who issued the token.

How to run on GitHub Actions

Use token of GitHub Actions

name: npm-update-package
on:
  schedule:
    - cron: '0 0 * * *'
jobs:
  npm-update-package:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
      - run: |
          npx npm-update-package \
            --github-token $GITHUB_TOKEN \
            --git-user-name $GIT_USER_NAME \
            --git-user-email $GIT_USER_EMAIL
        env:
          GIT_USER_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
          GIT_USER_NAME: github-actions[bot]
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Use token of GitHub App

name: npm-update-package
on:
  schedule:
    - cron: '0 0 * * *'
jobs:
  npm-update-package:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
      - name: Generate token
        id: generate_token
        uses: tibdex/github-app-token@v1
        with:
          app_id: ${{ secrets.APP_ID }}
          private_key: ${{ secrets.PRIVATE_KEY }}
      - run: |
          npx npm-update-package \
            --github-token $GITHUB_TOKEN \
            --git-user-name $GIT_USER_NAME \
            --git-user-email $GIT_USER_EMAIL
        env:
          # TODO: Replace with your GitHub App's email
          GIT_USER_EMAIL: 97396142+npm-update-package[bot]@users.noreply.github.com
          # TODO: Replace with your GitHub App's user name
          GIT_USER_NAME: npm-update-package[bot]
          GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

Use Personal access token

name: npm-update-package
on:
  schedule:
    - cron: '0 0 * * *'
jobs:
  npm-update-package:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
      - run: |
          npx npm-update-package \
            --github-token $GITHUB_TOKEN \
            --git-user-name $GIT_USER_NAME \
            --git-user-email $GIT_USER_EMAIL
        env:
          # TODO: Replace with your email
          GIT_USER_EMAIL: 97961304+npm-update-package-bot@users.noreply.github.com
          # TODO: Replace with your name
          GIT_USER_NAME: npm-update-package-bot
          GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

Architecture

The following shows the process flow of npm-update-package.

npm.io

FAQ

What is the purpose of npm-update-package?

npm-update-package can be used in environments where Renovate cannot be used for some reason.

What should I do if conflicts occurred in the pull request?

If you have difficulty resolving it manually, close the pull request and run npm-update-package again.

How to development

See Wiki.

3.0.22

23 hours ago

3.0.21

13 days ago

3.0.20

14 days ago

3.0.18

20 days ago

3.0.19

20 days ago

3.0.17

3 months ago

3.0.16

3 months ago

3.0.15

3 months ago

3.0.14

4 months ago

3.0.13

5 months ago

3.0.12

5 months ago

3.0.8

5 months ago

3.0.7

6 months ago

3.0.6

7 months ago

3.0.5

7 months ago

3.0.9

5 months ago

3.0.10

5 months ago

3.0.11

5 months ago

3.0.4

7 months ago

3.0.3

7 months ago

3.0.2

8 months ago

3.0.1

8 months ago

3.0.0

8 months ago

2.0.2

11 months ago

2.0.1

12 months ago

2.0.0

12 months ago

1.5.23

1 year ago

1.5.22

1 year ago

1.5.24

1 year ago

1.5.12

1 year ago

1.5.14

1 year ago

1.5.13

1 year ago

1.5.16

1 year ago

1.5.15

1 year ago

1.5.18

1 year ago

1.5.17

1 year ago

1.5.19

1 year ago

1.5.21

1 year ago

1.5.20

1 year ago

1.4.20

2 years ago

1.4.22

2 years ago

1.4.21

2 years ago

1.4.24

2 years ago

1.4.23

2 years ago

1.4.26

2 years ago

1.4.25

2 years ago

1.4.28

2 years ago

1.4.27

2 years ago

1.4.29

2 years ago

1.4.31

2 years ago

1.4.30

2 years ago

1.5.5

1 year ago

1.5.4

1 year ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

2 years ago

1.4.13

2 years ago

1.4.15

2 years ago

1.4.14

2 years ago

1.4.17

2 years ago

1.4.16

2 years ago

1.4.19

2 years ago

1.4.18

2 years ago

1.5.9

1 year ago

1.5.8

1 year ago

1.5.7

1 year ago

1.5.6

1 year ago

1.5.10

1 year ago

1.5.11

1 year ago

1.4.11

2 years ago

1.4.10

2 years ago

1.4.12

2 years ago

1.4.6

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.4.9

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.2.0

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.2.16

2 years ago

1.2.17

2 years ago

1.2.14

2 years ago

1.2.15

2 years ago

1.1.0

2 years ago

1.2.9

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.2.18

2 years ago

1.2.19

2 years ago

1.3.6

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.20

2 years ago

1.2.23

2 years ago

1.2.24

2 years ago

1.2.21

2 years ago

1.2.22

2 years ago

1.2.25

2 years ago

1.2.26

2 years ago

0.59.0

2 years ago

0.58.10

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.58.9

2 years ago

0.58.8

2 years ago

0.45.10

2 years ago

0.45.11

2 years ago

0.45.12

2 years ago

0.45.13

2 years ago

0.45.14

2 years ago

0.45.15

2 years ago

0.45.16

2 years ago

0.55.0

2 years ago

0.51.0

2 years ago

0.48.2

2 years ago

0.48.3

2 years ago

0.48.0

2 years ago

0.48.1

2 years ago

0.44.0

2 years ago

0.48.4

2 years ago

0.56.0

2 years ago

0.52.1

2 years ago

0.52.0

2 years ago

0.49.1

2 years ago

0.45.5

2 years ago

0.45.6

2 years ago

0.45.3

2 years ago

0.49.0

2 years ago

0.45.4

2 years ago

0.45.1

2 years ago

0.45.2

2 years ago

0.45.0

2 years ago

0.45.9

2 years ago

0.45.7

2 years ago

0.45.8

2 years ago

0.57.0

2 years ago

0.53.0

2 years ago

0.53.1

2 years ago

0.46.4

2 years ago

0.46.5

2 years ago

0.46.2

2 years ago

0.46.3

2 years ago

0.46.0

2 years ago

0.46.1

2 years ago

0.46.6

2 years ago

0.46.7

2 years ago

0.58.3

2 years ago

0.58.4

2 years ago

0.58.1

2 years ago

0.58.2

2 years ago

0.58.0

2 years ago

0.58.7

2 years ago

0.58.5

2 years ago

0.58.6

2 years ago

0.54.0

2 years ago

0.50.0

2 years ago

0.43.5

2 years ago

0.43.6

2 years ago

0.47.0

2 years ago

0.43.4

2 years ago

0.41.1

2 years ago

0.43.0

2 years ago

0.41.2

2 years ago

0.41.0

2 years ago

0.38.0

2 years ago

0.42.0

2 years ago

0.40.0

2 years ago

0.39.0

2 years ago

0.43.3

2 years ago

0.43.1

2 years ago

0.41.3

2 years ago

0.43.2

2 years ago

0.20.1

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.17.2

2 years ago

0.19.1

2 years ago

0.19.2

2 years ago

0.36.0

2 years ago

0.34.0

2 years ago

0.11.0

2 years ago

0.11.1

2 years ago

0.13.0

2 years ago

0.11.2

2 years ago

0.15.0

2 years ago

0.17.0

2 years ago

0.17.1

2 years ago

0.32.0

2 years ago

0.30.0

2 years ago

0.29.0

2 years ago

0.27.0

2 years ago

0.25.0

2 years ago

0.23.2

2 years ago

0.23.1

2 years ago

0.23.0

2 years ago

0.9.1

2 years ago

0.21.0

2 years ago

0.37.0

2 years ago

0.31.5

2 years ago

0.35.0

2 years ago

0.31.4

2 years ago

0.31.3

2 years ago

0.33.0

2 years ago

0.31.2

2 years ago

0.12.0

2 years ago

0.14.0

2 years ago

0.16.0

2 years ago

0.16.1

2 years ago

0.18.0

2 years ago

0.16.2

2 years ago

0.10.0

2 years ago

0.31.1

2 years ago

0.31.0

2 years ago

0.28.1

2 years ago

0.28.0

2 years ago

0.26.1

2 years ago

0.24.3

2 years ago

0.26.0

2 years ago

0.24.2

2 years ago

0.22.4

2 years ago

0.24.1

2 years ago

0.22.3

2 years ago

0.24.0

2 years ago

0.22.2

2 years ago

0.22.1

2 years ago

0.22.0

2 years ago

0.28.3

2 years ago

0.28.2

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago