You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

isnumber

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isnumber

A simple test to see if a value is a non-infinite number.


Version published
Weekly downloads
115K
decreased by-3.23%
Maintainers
1
Install size
3.82 kB
Created
Weekly downloads
 

Package description

What is isnumber?

The isnumber npm package is a utility that helps determine if a given value is a number. It is useful for validation and type-checking in JavaScript applications.

What are isnumber's main functionalities?

Basic Number Check

This feature allows you to check if a given value is a number. It returns true for numeric values and false for non-numeric values.

const isNumber = require('isnumber');
console.log(isNumber(123)); // true
console.log(isNumber('123')); // false

Check for NaN

This feature ensures that NaN (Not-a-Number) is correctly identified as not being a number.

const isNumber = require('isnumber');
console.log(isNumber(NaN)); // false

Check for Infinity

This feature allows you to check if a value is Infinity, which is considered a number in JavaScript.

const isNumber = require('isnumber');
console.log(isNumber(Infinity)); // true

Other packages similar to isnumber

Readme

Source

isNumber

NPM

isNumber is a super tiny module that provides a test to see if a value is a finite number.

By super tiny, I mean like a single line -- however, I tend to use this somewhat frequently, so module it is!

var isNumber = require("isnumber")

isNumber(13) // true
isNumber("1241.12") // true
isNumber(0xff) // true

isNumber(Infinity) // false
isNumber("cat") // false
isNumber({foo: "bar"}) // false

LICENSE

MIT

Keywords

FAQs

Package last updated on 14 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc