is-positive ![Build Status](https://camo.githubusercontent.com/749c211333a4114d47b49a91956aaaf78a207c958135bfc4030e0c3bc7908535/68747470733a2f2f7472617669732d63692e6f72672f6b657676612f69732d706f7369746976652e7376673f6272616e63683d6d6173746572)
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
- is-negative - Check if something is a negative number
License
MIT © Kevin Martensson