npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

is-unlucky

v0.2.0

Published

Check if a number is unlucky

Readme

is-unlucky

An npm package to check if a number is unlucky. Meant as an alternative to is-thirteen.

Why use it?

  1. You might want to use is-thirteen to find whether a number is unlucky. However, that may cause trouble for people in other parts of the world where different numbers are unlucky. For example, in Japan, 4 and 9 are considered unlucky. This package considers 4, 9, 13, and 17 to be unlucky, and issues with more unlucky numbers from other cultures are welcome.

  2. This package also can be used to test whether numbers are lucky. 7 and 8 are considered lucky.

  3. If you really wanted to check whether a number is 13, you still can. Just use the thirteen method!

  4. The syntax is pleasantly English-like, as seen in the examples below this list.

  5. There is 100% test coverage.

  6. is-unlucky exposes all its internals in an internals export, so if you want to play around with it you can.

  7. is-unlucky is more honest than is-thirteen about whether something is 13. Let's face it: the letter B is not thirteen, neither is it unlucky.

  8. It has testing for whether a number is 8, not just 13. This can be extended to other numbers by users via the define function.

Examples

const {is, are, does} = require('./');

is(13).unlucky(); // true
is(4).unlucky(); // true

is(4).plus(5).unlucky();      // true
is(12).plus(1).unlucky();    // true
is(4).minus(12).unlucky();    // false
is(14).minus(1).thirteen();    // true
is(1).times(8).unlucky();    // false
is(26).dividedBy(2).unlucky();  // true

is(8).lucky(); // true
is(3).plus(4).lucky(); // true
is(8).not.unlucky(); // true

is(8).thirteen(); // false
is(8).plus(5).thirteen(); // true
is(8).eight(); // true

does([1, 2, 13]).contain.any.unluckyNumbers(); // true
does([1, 2, 13]).contain.only.unluckyNumbers(); // false
does([1, 2, 13]).contain.any.eight(); // false
are.any.of([1, 2, 3]).lucky(); // false

is('B').thirteen(); // false
is('B').unlucky(); // false

License

MIT