Npm-check-updates: Ignore pinned versions

Created on 9 Jul 2019  ยท  10Comments  ยท  Source: raineorshine/npm-check-updates

  • [x] I have read the list of known issues before filing this issue.
  • [x] I have searched for similiar issues before filing this issue.

  • node version: 12.4.0

  • npm version: 6.10.0
  • npm-check-updates version: 3.1.17

First of all: Big props!

Second here is an example of an ncu output:

 core-js                      ^2.6.9  โ†’   ^3.1.4 
 tslib                        ^1.9.0  โ†’  ^1.10.0 
 karma-jasmine                ~1.1.2  โ†’   ~2.0.1 
 karma-jasmine-html-reporter  ^0.2.2  โ†’   ^1.4.2 
 protractor                    5.4.0  โ†’    6.0.0 
 ts-node                      ~7.0.0  โ†’   ~8.3.0 
 typescript                    3.4.1  โ†’    3.5.3 

Suggests the update of typescript and protractor.

It would be helpful to ignore pinned packages (no ~ or ^).

Is this intentional and is there another way to to this?

Most helpful comment

Published in v10.2.0. Try it out!

ncu --filterVersion "/^[~^]/"

This includes less than, greater than, exact ranges, and .x:

ncu --filterVersion "/^[~^<>]| - |\.x$/"

All 10 comments

Please see https://github.com/tjunnone/npm-check-updates/issues/540#issuecomment-494125271

You could use the ncu -x option.

Thanks!

Unearthing this old thread here - wouldn't it be beneficial to have an option to ignore pinned versions automatically?
I would like to avoid running ncu then look at all the versions make a note on the pinned ones and then run ncu again with excluding the pinned versions one by one manually.
I guess going the other way round and filtering for regex "starts with ~ or ^" won't work either since the filter only checks the name afterwards, right?

I guess going the other way round and filtering for regex "starts with ~ or ^" won't work either since the filter only checks the name afterwards, right?

I think it would be reasonable to have an equivalent of filter and reject that works on the version, say filter-version and reject-version. Would that work for you?

Thanks @raineorshine for considering! Hmm, how would that work? With version numbers or semver indicators?

Regex on the entire dependency value as listed in your package.json, e.g. "^6.0.0"

Ahh sweet so then I would say filter-version regex starts with ^ or ~ to ultimately get everything but pinned versions ๐Ÿ‘

Published in v10.2.0. Try it out!

ncu --filterVersion "/^[~^]/"

This includes less than, greater than, exact ranges, and .x:

ncu --filterVersion "/^[~^<>]| - |\.x$/"

This is incredible. Thank you so much for this amazing fast feature implementation! โค๏ธ๐Ÿš€

Works perfectly!

Was this page helpful?
0 / 5 - 0 ratings