npm install typis --save
const type = require('typis');
console.log(type.get([])); //=> Array;
console.log(type.get(123)); //=> Number;
console.log(type.get(true)); //=> Boolean;
console.log(type.is(123, 'boolean')); //=> false;
// Throw an error
type.throw(123, 'boolean'); //=> error;
type.throw(123, 'boolean', 'your custom message error'); //=> error;
You can view the changelog here
typis is open-sourced software licensed under the MIT license