Npm-check-updates: Update multiple package.json files at once

Created on 28 Aug 2017  Â·  7Comments  Â·  Source: raineorshine/npm-check-updates

Feature Request

We have a project workspace which consist of multiple modules. I love "ncu" and it would be awesome, if we could add a feature like -R or --recursive to scan all subfolders for package.json files.

For example, this is our workspace:

project/package.json
  lib/
    tool-a/package.json
    tool-b/package.json
  themes/
    theme-a/package.json
    theme-b/package.json

Right now, I check every folder manually, but an _update all at once_ feature would be awesome. What do you think?

enhancement

Most helpful comment

I do this to upgrade all package.json inside a directory:
find . -type f -name 'package.json' -not -path './.git/*' -not -path '*/node_modules/*' -execdir ncu --upgrade \;

See https://github.com/tkrotoff/react-form-with-constraints/blob/v0.14.0/package.json#L22

All 7 comments

What about a shell script that cd's into each folder and runs ncu? I understand that you may want a more automated solution, but that's the quickest thing I can think of! ncu can also be used as a node module.

Hi @raineorshine, I know, a shell script is the quickest solution, which I will use. But I thought, this idea could be a nice enhancement, which I should share with you at least.

Yes! Good thinking! Thanks!

On Tue, Aug 29, 2017 at 3:43 AM Michael Riehemann notifications@github.com
wrote:

Hi @raineorshine https://github.com/raineorshine, I know, a shell
script is the quickest solution, which I will use. But I thought, this idea
could be a nice enhancement, which I should share with you at least.

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/tjunnone/npm-check-updates/issues/387#issuecomment-325612359,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAtyxDpn_GsEKCUmgO4ETc9stce1Jvzaks5sc91XgaJpZM4PEcxe
.

I do this to upgrade all package.json inside a directory:
find . -type f -name 'package.json' -not -path './.git/*' -not -path '*/node_modules/*' -execdir ncu --upgrade \;

See https://github.com/tkrotoff/react-form-with-constraints/blob/v0.14.0/package.json#L22

What happened with this issue ?
It is still actual ?

@js2me It is recommended to use a shell script such as suggested by @tkrotoff. npm-check-updates will not handle this natively.

although the shell script way works, it has some defects like time consuming (it might check one same package over and over again) and os compatibility.. i would very much expect it to be a native feature of ncu

it is very helpful when we use lerna to manage our sub-packages

so please make it happen :)

Was this page helpful?
0 / 5 - 0 ratings