.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / randomatic / node_modules / is-number / README.md
1 # is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number)
2
3 > Returns true if the value is a number. comprehensive tests.
4
5 Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
6
7 ## Install
8
9 Install with [npm](https://www.npmjs.com/):
10
11 ```sh
12 $ npm install --save is-number
13 ```
14
15 ## Usage
16
17 To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81).
18
19 ```js
20 var isNumber = require('is-number');
21 ```
22
23 ### true
24
25 See the [tests](./test.js) for more examples.
26
27 ```js
28 isNumber(5e3)      //=> 'true'
29 isNumber(0xff)     //=> 'true'
30 isNumber(-1.1)     //=> 'true'
31 isNumber(0)        //=> 'true'
32 isNumber(1)        //=> 'true'
33 isNumber(1.1)      //=> 'true'
34 isNumber(10)       //=> 'true'
35 isNumber(10.10)    //=> 'true'
36 isNumber(100)      //=> 'true'
37 isNumber('-1.1')   //=> 'true'
38 isNumber('0')      //=> 'true'
39 isNumber('012')    //=> 'true'
40 isNumber('0xff')   //=> 'true'
41 isNumber('1')      //=> 'true'
42 isNumber('1.1')    //=> 'true'
43 isNumber('10')     //=> 'true'
44 isNumber('10.10')  //=> 'true'
45 isNumber('100')    //=> 'true'
46 isNumber('5e3')    //=> 'true'
47 isNumber(parseInt('012'))   //=> 'true'
48 isNumber(parseFloat('012')) //=> 'true'
49 ```
50
51 ### False
52
53 See the [tests](./test.js) for more examples.
54
55 ```js
56 isNumber('foo')             //=> 'false'
57 isNumber([1])               //=> 'false'
58 isNumber([])                //=> 'false'
59 isNumber(function () {})    //=> 'false'
60 isNumber(Infinity)          //=> 'false'
61 isNumber(NaN)               //=> 'false'
62 isNumber(new Array('abc'))  //=> 'false'
63 isNumber(new Array(2))      //=> 'false'
64 isNumber(new Buffer('abc')) //=> 'false'
65 isNumber(null)              //=> 'false'
66 isNumber(undefined)         //=> 'false'
67 isNumber({abc: 'abc'})      //=> 'false'
68 ```
69
70 ## About
71
72 <details>
73 <summary><strong>Contributing</strong></summary>
74
75 Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
76
77 </details>
78
79 <details>
80 <summary><strong>Running Tests</strong></summary>
81
82 Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
83
84 ```sh
85 $ npm install && npm test
86 ```
87
88 </details>
89
90 <details>
91 <summary><strong>Building docs</strong></summary>
92
93 _(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
94
95 To generate the readme, run the following command:
96
97 ```sh
98 $ npm install -g verbose/verb#dev verb-generate-readme && verb
99 ```
100
101 </details>
102
103 ### Related projects
104
105 You might also be interested in these projects:
106
107 * [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.")
108 * [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.")
109 * [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.")
110 * [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive.  | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ")
111 * [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")
112 * [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.")
113
114 ### Contributors
115
116 | **Commits** | **Contributor** | 
117 | --- | --- |
118 | 38 | [jonschlinkert](https://github.com/jonschlinkert) |
119 | 5 | [charlike](https://github.com/charlike) |
120
121 ### Author
122
123 **Jon Schlinkert**
124
125 * [github/jonschlinkert](https://github.com/jonschlinkert)
126 * [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
127
128 ### License
129
130 Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
131 Released under the [MIT License](LICENSE).
132
133 ***
134
135 _This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on October 17, 2017._