From a0878abeb4dba95fe2017c2768f278e67f1d9269 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 24 Feb 2014 16:34:54 -0600 Subject: [PATCH] added Install / Usage and API TOC --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b75681..b422bcb 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,31 @@ 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 -### 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