is-positive

Check if something is a positive number

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
is-positive
6513.1.08 years ago8 years agoMinified + gzip package size for is-positive in KB

Readme

is-positive Build Status
Check if something is a positive number

Install

$ npm install --save is-positive

Usage

const isPositive = require('is-positive');

isPositive(1);
//=> true

isPositive(0);
//=> false

isPositive(-1);
//=> false

isPositive('1');
//=> false

isPositive(Number(1))
//=> true

Note: This module doesn't consider 0 to be a positive number and doesn't distinguish between -0 and 0. If you want to detect 0, use the positive-zero module.

Related

License

MIT © Kevin Martensson