[![npm version](https://img.shields.io/npm/v/@d3v4pp/type?style=flat)](https://www.npmjs.com/package/@d3v4pp/type) [![GitHub license](https://img.shields.io/badge/licence-d3v4pp-red.svg)](https://cvs.d3v4pp.fr/D3V4PP/type.git) # @d3v4pp/type just a function `type` that is less-broken `typeof`, and a little bit more precise. ## Install ```shell npm install --save @d3v4pp/type ``` ## Example ```js var type = require('@d3v4pp/type'); var obj = new Date; if (type(obj) == 'date') { ... } ``` ## How to use ```js type(new Date) == 'date' type({}) == 'object' type(null) == 'null' type(undefined) == 'undefined' type("hey") == 'string' type(true) == 'boolean' type(false) == 'boolean' type(12) == 'number' type(type) == 'function' type(/asdf/) == 'regexp' type((function(){ return arguments })()) == 'arguments' type([]) == 'array' type(document.createElement('div')) == 'element' type(NaN) == 'nan' type(new Error('Ups! Something wrong...')) == 'error' type(new Buffer) == 'buffer' ``` ____ BY : [@d3v4pp](https://d3v4pp.fr)