Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-prime-number

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-prime-number

Returns boolean of if provided number is prime.

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

is-prime-number

Node.js JavaScript module to determine whether the passed value is a prime number.

npm install is-prime-number

Syntax

isPrime(value);

Parameters

  • value The value to be tested for being a prime number.

Return value

A boolean indicating whether or not the given value is a prime number.

Examples

const isPrime = require('is-prime-number');

console.log( isPrime(2) ); // true
console.log( isPrime(7) ); // true

console.log( isPrime(20) ); // false
console.log( isPrime({}) ); // false

Keywords

FAQs

Package last updated on 14 Jan 2018

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc