Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mikefrey committed Mar 14, 2013
1 parent 8e3306c commit 6989460
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,47 @@
prove
=====

Validation sugar with is
Validation sugar with is-it

Installation
------------

```bash
npm install prove
```

Usage
-----

```javascript
var prove = require('prove')

if (var errs = prove(5).is('integer greaterThan(0)').errors) {
// not valid
}
```

prove can also be chained:

```javascript
prove('foo').is('string').isnt('integer').errors
```

API
---

### prove(value)

Returns a chainable object with `is`, `isnt` and `errors`.

### .is(conditions)

Runs the listed conditions against the value provided in `prove`.

### .isnt(conditions)

Runs the conditions against the value provided in `prove` but negated.

### .errors

This property contains an array of invalid conditions, or `null`.

0 comments on commit 6989460

Please sign in to comment.