npm.io
0.0.2 • Published 9 years ago

this-is

Licence
MIT
Version
0.0.2
Deps
0
Vulns
0
Weekly
0

Intro

An interface for various checks with ability to stringify to the readable format.

Installation

npm install --save this-is

Append to project

nodejs

var this_is = require('this-is');
browser
<script type="text/javascript" src="[path to node modules]/this-is/index.js"></script>

Usage


var gt5 = this_is.gt(5);
JSON.stringfy(gt5); // {$check: {gt: 5}}
gt5.check(6); // true
gt5.check(4); // false

var btw10and100 = this_is.btw(10, 100);
JSON.stringfy(btw10and100); // {$check: {btw: [10, 100]}}
btw10and100.check(0); // false
btw10and100.check(50); // true
btw10and100.check(150); // false