-1

Using the semver NPM package https://docs.npmjs.com/misc/semver

is there a way to convert a package version like so ^4.2.3, to one that is without the ^? I just need to do string manipulation to remove any preceding characters that are not numbers, I suppose.

Alexander Mills
  • 90,741
  • 139
  • 482
  • 817

1 Answers1

0

Ah yes, the answer is in the docs, of course: https://docs.npmjs.com/misc/semver

it says:

semver.clean('  =v1.2.3   ') // '1.2.3'
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817