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 🙏

© 2024 – Pkg Stats / Ryan Hefner

wildleek

v2.0.0

Published

A simple package that checks a given password against a list of common passwords, without any network requests.

Downloads

243

Readme

Wild Leek

A simple package that checks if a password is on a list of the 10,000 most common passwords.

No network requests are made.

Usage

const passwordInTheWild = require('wildleek');

// In an async function
async function registerUser(username, password) {
    if(await passwordInTheWild(password)) {
        console.error("The password provided is too common to be used safely");
        return false;
    } else {
        // Allow user to use password
    }
}

// Using callbacks
passwordInTheWild("password123").then(wild => {
    if(wild) {
        console.error("The password provided is too common to be used safely");
    } else {
        // Allow user to use password
    }
});

The passwordInTheWild(password) function returns a promise that resolves to true if the password is on the top list and false if it is not.

Eager loading: The password list can be loaded before it is needed by calling passwordInTheWild.eagerLoadPasswords()

Implementation

passwordInTheWild(password) loads an alphabetized list of the 10,000 most common passwords into an array when the function is first called. It then performs a binary search to check if the given password is in the array.

The array is kept in memory (The file is 74.7 KB). The first password check takes about 27ms on my budget machine. The second password check takes under 1ms. The main expense of the package is the time spent loading the file into memory. After it's loaded checking a password is quick.

Disclaimer

This package is intended for server-side password strength checks. This package will not make your security invincible. An attacker might be able to deduce that your software uses this package, and avoid using the passwords in the list when trying to brute force their way into your application.

The best way to view this package is as an encouragement to make your users be creative with their passwords.

I am not a security professional and recommend that all mission critical software be vetted by a competent one before entering production.

Credits

The current password list is the Top 10,000 Passwords (MIT LICENSE). according to Daniel Miessler's SecLists. See relevant license file in /passwords subdirectory. It has been alphabetized so it can be binary searched, and a newline has been added so that a blank password is marked wild.

The only npm dependency is binary-search.