/typeisjs

Typeis. it's the smart and simple javaScript type checker

Primary LanguageJavaScript

#typeis.js ##Typeis. it's the smart and simple javaScript type checker;

###installation ####npm

npm install typeis

####bower

bower install typeis

###usage

####nodejs

require('typeis');

####browser

<script src="node_modules/typeis/typeis.js"></script>

####examples

var regexp = /test/gi
var arr = ['test'];
var now = new Date();
var obj = {};

console.log(regexp.typeis()); //RegExp;
console.log(regexp.typeis('regexp')); //true;
console.log(regexp.typeis('object')); //false;
console.log(arr.typeis()); //Array;
console.log(arr.typeis('array')); //true;
console.log(now.typeis()); //Date;
console.log(obj.typeis()); //Object;

####Real world Usage

function realWorld( options ){
    if(options.typeis('object')){
        //do something
    } else {
        //do another something
    }
}