If you were to use the [semver](https://www.npmjs.com/package/semver) package, you could easily have full semver range syntax support.