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

pwkit

v0.0.6

Published

Modern, customizable password generator with entropy analysis and flexible character group settings.

Readme

PWkit

PWkit

Modern, customizable password generator and tester with entropy analysis and flexible character group settings.

See a small demo, that uses this package!

Import into your project

pnpm add pwkit
npm install pwkit
yarn add pwkit

Usage

generate a password

import { password } from "pwkit";

// initialize
const pwd = password();

// use with default settings
console.log(pwd.create());

more advanced usage

import { password } from "pwkit";

const options = {
  length: 12,
  lowercase: 4,
  symbols: 3,
};
const pwd = password(options);

// generates a random password with a length of 12
// and ensures that at least 4 lower-case letters and
// at least 3 symbols are used for the generation.
console.log(pwd.create());

Test a password

import { password } from "pwkit";

const pwd = password();
const myPassword = '.Pa55-W0rD';
const result = pwd.test(myPassword);

console.log(result);

Methods

create(options?)

const options = {
  // see below
};
const pwd = password(options);
const myPassword = pwd.create();

console.log(myPassword);
// returns, eg.:
// {
//   entropy: 65.23561956057013
//   length: 10
//   password: "7)9uUIU]vg"
//   statistic: {
//     lowercase: 3,
//     uppercase: 3,
//     numbers: 2,
//     symbols: 2,
//     umlauts: 0
//   }
//   strength: 0.6523561956057012,
// }

test(string)

const pwd = password();
const myPassword = '.Pa55-W0rD';

const test = pwd.test(myPassword);
console.log(tmp);
// returns:
// {
//   entropy: 65.23561956057013,
//   length: 10,
//   statistic: {
//     lowercase: 2,
//     uppercase: 3,
//     numbers: 3,
//     symbols: 2,
//     umlauts: 0,
//   },
//   strength: 0.6523561956057012,
// }

setCharGroups()

to override the character groups

const pwd = password();
const myNewGroups = {
  lowercase: 'abcdefg',
  uppercase: 'HIJKMLN',
  numbers: '0123456',
  symbols: '!"§$%&/',
}
pwd.setCharGroups(myNewGroups);

resetCharGroups()

reset all Groups to their default value

const pwd = password();
pwd.resetCharGroups();

updateSettings()

Useful to override the settings. The old settings will be overwritten!

const pwd = password();
const myNewSettings = {
  length: 32,
  // and others, see options
};
pwd.updateSettings(myNewSettings);

getCharset()

returns all characters (that are used for password generation) as a string.

const pwd = password();
const chars = pwd.getCharset();
console.log(chars);

options

options = {
  // the length of the password
  // default: 10
  length: 10,

  // should lowercase chars be included
  // values: true | false | number
  // e.g.: 3 (use at least 3 chars from the lowercase character-set)
  // default: true
  lowercase: true,

  // should uppercase chars be included
  // values: true | false | number
  // e.g.: 3 (use at least 3 chars from the uppercase character-set)
  // default: true
  uppercase: true,

  // should numbers chars be included
  // values: true | false | number
  // e.g.: 3 (use at least 3 chars from the numbers character-set)
  // default: true
  numbers: true,

  // should symbols chars be included
  // values: true | false | number
  // e.g.: 3 (use at least 3 chars from the symbols character-set)
  // default: true
  symbols: true,

  // should umlauts chars be included
  // values: true | false | number
  // e.g.: 3 (use at least 3 chars from the umlauts character-set)
  // default: false
  umlauts: false,

  // exclude similar looking characters like '0' and 'O'
  // values: true | false
  // default: false
  excludeSimilar: false,

  // try to distribute normal over the the selected character-sets!
  // e.g.: if set to true, length set to 16, and lowercase, uppercase, numbers, and symbols are set to true. We get 4 lowercase, 4 uppercase, 4 numbers and 4 symbols in the resulting password
  // values: true | false
  // default: false
  normalDistribute: false,
}