Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevva/is-positive
Check if something is a positive number
https://github.com/kevva/is-positive
Last synced: 2 months ago
JSON representation
Check if something is a positive number
- Host: GitHub
- URL: https://github.com/kevva/is-positive
- Owner: kevva
- License: mit
- Created: 2015-06-02T12:01:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T16:41:24.000Z (over 7 years ago)
- Last Synced: 2024-11-07T08:45:13.595Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 67
- Watchers: 8
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-hilarious-repos - is-positive - check whether a number is positive or not (sadly some people use this omg) (Libraries, Frameworks and SDKs)
README
# is-positive [![Build Status](https://travis-ci.org/kevva/is-positive.svg?branch=master)](https://travis-ci.org/kevva/is-positive)
> Check if something is a positive number
## Install
```
$ npm install --save is-positive
```## Usage
```js
const isPositive = require('is-positive');isPositive(1);
//=> trueisPositive(0);
//=> falseisPositive(-1);
//=> falseisPositive('1');
//=> falseisPositive(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`](https://github.com/sindresorhus/positive-zero) module._
## Related
- [is-negative](https://github.com/kevva/is-negative) - Check if something is a negative number
## License
MIT © [Kevin Martensson](http://github.com/kevva)