1.1.69420 • Published 1 year ago

is-prime-fast v1.1.69420

Weekly downloads
-
License
Beerware (Modifie...
Repository
github
Last release
1 year ago

is-prime-fast NPM version NPM monthly downloads NPM total downloads

Detect whether a value is an prime number.

Install

Install with npm:

$ npm install is-prime-fast 

Usage

var isPrime = require('is-prime-fast');


//it works with integers
isPrime(50);
//=> "I'm detecting non-prime behavior in this number." (every time you get random response)

// it also works with strings
isPrime("321");
//=> "I'm getting the sense that this number is composite."

//it also works with numbers written using words
isPrime("one hundred and eighteen");
//=> "I'm getting the feeling that this number is not a prime."

// It also works with almost every language:

//German
isPrime('vierundzwanzig');// 24
//=> "I don't think this is a prime."

//Spanish 
isPrime("sesenta y ocho");// 68
//=> "It appears that this number is not a prime."

//Polish
isPrime("Sześćdziesiąt dziewięć") // 69
//=> "This number isn't showing any prime-like properties."

//And sometimes it doesn't work
isPrime(7)
//=> "This number doesn't seem to fit the definition of a prime."

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Running tests

Bruh, who needs tests?

Author

Krzysztof Pniaczek

License

Copyright © 2023, Krzysztof Pniaczek. Released under the Beerware License (Modified).

1.1.69420

1 year ago

1.1.695

1 year ago

1.1.694

1 year ago

1.1.693

1 year ago

1.1.692

1 year ago

1.1.691

1 year ago

1.1.69

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.3

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago