JSPM

  • Created
  • Published
  • Downloads 2217555
  • Score
    100M100P100Q187514F

A type checking library where each exported function returns either true or false and does not throw.

Package Exports

  • is2

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

is2

is2 is a type-checking module for node.js to test values. Is does not throw exceptions. Use is2 to validate types in your node.js code. Every function in is2 returns either true of false.

After finding Enrico Marino's module is, the concise syntax amazed, but there were syntax issues that made using is difficult. This fork of is fixes though issues, but the module is no longer cross-platform.

Installation

To install is2, type:

$ npm install is2

Usage

var is = require('is2');

console.log('true is equal to 1===1: '+(is.equal(true, 1===1));
console.log('10 is a positive number: '+(is.positiveNumber(10));
console.log('11 is an odd number: '+(is.oddNumber(11));