npm-check-updates
npm-check-updates copied to clipboard
Feature: --age or --filterMeta
Running into a slight challenge when using ncu due to being on a corp registry that only syncs on a cron. Packages that have been published between crons are not available on the corp registry yet. It would be handy to have a flag that would allow us to specify an age in hours for the packages to be updated. Anything younger than that age would be excluded from the update.
I have been using the tool for years and never run into this before, but Babel is doing updates across their packages right now and it has been preventing us from using ncu easily for the past few days. If there was a way to specify "only update packages that were published more than 12 hours ago" it would solve the concern. It might also be a nice "comfort" feature for those concerned about dangerous code updates.
Thanks for the suggestion! Maybe something like --filterVersion
but for package metadata, i.e. --filterMeta "time > 12hrs"
.
--filterMeta
is a great idea. Additional use-case are packages that need to stay on the same version because they are published from the same monorepo but for some reason filtering by name is not suffice.
In my organization we publish packages within org scope, say @myorg/*
. Some of those packages use parallel versioning and some do not, so we would like to be able to filter by meta property like repository url ncu "@myorg/*" --filterMeta "repository.url = https://github.com/myorg/myrepo.git"
Two words about my use case - in our org we have internal npm repo which ignores any packages from npm.org that are younger than 72 hours for security reasons. It means that some of ncu upgrade recommendations cannot be done and it takes time to understand which upgrades are working and which are not.
This option could benefit from supporting functions, like the recent enhancement to target
: https://github.com/raineorshine/npm-check-updates/pull/1052.
--filterMeta
is a nice generalization, though I think a --min-age
option would be convenient, even if it was just an alias for --filterMeta "time > 72hrs"
.
Maybe the naming of the alias could be aligned with Renovate (the only place where I did find this feature!), it's called stabilityDays
Also stabilityDays
is mentioned in this RFC: https://github.com/npm/rfcs/issues/549