added Install / Usage and API TOC

This commit is contained in:
AJ ONeal 2014-02-24 16:34:54 -06:00
parent 3f553abd40
commit a0878abeb4
1 changed files with 23 additions and 1 deletions

View File

@ -2,9 +2,31 @@
Some utils that aren't provided by the mainstream `semver` module. Some utils that aren't provided by the mainstream `semver` module.
### Usage
```bash
npm install --save semver-utils
```
```javascript
'use strict';
var semverUtils = require('semver-utils')
, version = require('./package.json').version
, semver = semverUtils.parse(version)
;
console.log(semver);
```
## API ## API
### parse(semverString) * semverUtils.parse(semverString)
* semverUtils.stringify(semverObject)
* semverUtils.parseRange(rangeString)
* semverUtils.stringifyRange(rangeArray)
### semverUtils.parse(semverString)
Turns a string such as `1.0.6-1+build-623` into the object Turns a string such as `1.0.6-1+build-623` into the object