https://github.com/jaebradley/has-a-digit
0️⃣ Checks if an input has a digit
https://github.com/jaebradley/has-a-digit
javascript node-module
Last synced: 1 day ago
JSON representation
0️⃣ Checks if an input has a digit
- Host: GitHub
- URL: https://github.com/jaebradley/has-a-digit
- Owner: jaebradley
- License: mit
- Created: 2018-07-12T17:58:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T18:35:44.000Z (about 6 years ago)
- Last Synced: 2025-10-24T08:15:14.368Z (8 months ago)
- Topics: javascript, node-module
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/has-a-digit
- Size: 7.12 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://greenkeeper.io/)
[](https://travis-ci.org/jaebradley/has-a-digit)
[](https://codecov.io/gh/jaebradley/has-a-digit)
[](https://www.npmjs.com/package/has-a-digit)
[](https://www.npmjs.com/package/has-a-digit)
# has-a-digit
Check if an input has a digit.
## Installation
```bash
npm install has-a-digit
```
```bash
yarn add has-a-digit
```
## Usage
```javascript
import hasADigit from 'has-a-digit';
hasADigit(1); // true
hasADigit(1.23); // true
hasADigit(Infinity); // false
hasADigit(NaN); // false
hasADigit({}); // false
hasADigit(true); // false
hasADigit('1'); // true
hasADigit('1.23'); // true
hasADigit('abc123'); // true
```