semver-range-types
v1.0.0
Published
Parse the semver range types from a dependencies object
Downloads
246
Maintainers
Readme
semver-range-types
Parse the semver range types from a dependencies object
Install
$ npm install --save semver-range-types
Usage
var semverRangeTypes = require('semver-range-types')
semverRangeTypes({foo: '~1.2.3'})
//=> {'~': ['foo'], '^': [], '': [], other: []}
Packages are categorized by their semver operator:
~
^
- none (an exact version)
- other (an arbitrary range, e.g.
>= 4.0.0 <= 10.0.0
)
API
semverRangeTypes(dependencies)
-> object
dependencies
Required
Type: string
A dependency object, like the ones in package.json.
License
MIT © Ben Drucker