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 🙏

© 2026 – Pkg Stats / Ryan Hefner

quickidgen

v1.2.1

Published

A lightweight utility for generating short, unique, and random IDs, ideal for quick usage in various applications.

Readme

quickidgen

npm version

quickidgen is a lightweight, customizable, and easy-to-use JavaScript utility for generating short and random unique IDs. It supports generating IDs with numbers, lowercase letters, uppercase letters, and special characters. You can also exclude specific characters based on your requirements, making it highly flexible for various use cases.

Key Features

  • Customizable Length: Define the length of the ID (default is 10).
  • Flexible Character Sets: Choose to include numbers, lowercase, uppercase letters, and special characters.
  • Character Exclusion: Exclude specific characters from the generated ID.
  • Prefix and Suffix: Add custom characters at the beginning and end of the generated ID.
  • Lightweight: Minimal dependencies, easy to integrate.
  • Randomness: Generates IDs that are random and unique for each use case.
  • forWeb Functionality: Customize ID generation based on web use cases.
  • UUID Generation: Generate IDs in UUID format with customizable parts.
  • Error Boundary: Handles cases where no characters are available for ID generation.
  • Readable ID Support: Ability to provide your own charset for generating IDs.

Installation

You can install quickidgen via npm:

npm install quickidgen

Usage

Using quickidgen is simple and highly flexible. Here's an example of how to use it:

Basic Usage

const generateRandomId = require('quickidgen');

// Generate a random ID with default options
const id = generateRandomId();
console.log(id);  // Example: 'a8G!5hT7@p'`

Custom Options

You can also customize the ID generation by passing an options object:

const generateRandomId = require('quickidgen');

// Generate a 15-character ID with only numbers and lowercase letters
const customId = generateRandomId({
  length: 15,
  useNumbers: true,
  useLowercase: true,
  useUppercase: false,
  useSpecialChars: false,
});
console.log(customId);  // Example: '8g7h9w3b1qz0t2y'`

Excluding Specific Characters

If you want to exclude specific characters, you can do so by specifying them in the excludeChars option:

const generateRandomId = require('quickidgen');

// Generate an ID, excluding specific characters like '1' and 'a'
const idWithoutChars = generateRandomId({
  excludeChars: '1a',
});
console.log(idWithoutChars);  // Example: 'G!9T%bE@'`

Adding Prefix and Suffix

You can add custom characters at the beginning and end of the generated ID:

const generateRandomId = require('quickidgen');

// Generate an ID with a prefix and suffix
const idWithPrefixSuffix = generateRandomId({
  prefix: 'ID-',
  suffix: '-2024',
});
console.log(idWithPrefixSuffix);  // Example: 'ID-a8G!5hT7@p-2024'

Web Functionality

Use the forWeb option to customize ID generation for web use cases:

const generateRandomId = require('quickidgen');

// Generate an ID optimized for web usage
const webId = generateRandomId({
  forWeb: true,
});
console.log(webId);  // Example: 'G!9T%bE@'

UUID Generation

To generate a UUID, use the isUUID option:

const generateRandomId = require('quickidgen');

// Generate a UUID
const uuid = generateRandomId({
  isUUID: true,
});
console.log(uuid);  // Example: '123e4567-e89b-12d3-a456-426614174000'

Readable ID

You can define your own character set for ID generation:

// Generate an ID with a custom character set
const customCharsetId = generateRandomId({
  isReadable: true,
  customWordsArr: ["Hello", "World"] 
});

console.log(customCharsetId);  // Example: 'HelloWorld'

Important Note

  • If you want to generate a UUID (isUUID: true), you cannot generate a readable ID (isReadable: true) simultaneously. Please choose one option at a time.

Options

| Option | Type | Default | Description | | ----------------- | ------- | ------- | --------------------------------------------------------------- | | length | Number | 10 | Length of the generated ID | | useNumbers | Boolean | true | Whether to include numbers in the ID | | useLowercase | Boolean | true | Whether to include lowercase letters | | useUppercase | Boolean | true | Whether to include uppercase letters | | useSpecialChars | Boolean | true | Whether to include special characters (e.g., @!#) | | excludeChars | String | "" | A string of characters to exclude from the ID generation | | prefix | String | "" | Characters that appear at the beginning of the generated string | | suffix | String | "" | Characters that appear at the end of the generated string | | forWeb | Boolean | false | Whether to customize ID generation for web use cases | | isUUID | Boolean | false | Whether to generate the ID in UUID format | | customWordsArr | Array | [] | An array of predefined words for generating readable IDs |

Changelog

[1.2.0]

  • Added: Improved randomness algorithm for better uniqueness.
  • Added: Support for generating readable IDs with predefined words using customWordsArr(even if you won't pass custom words predefined words will come).
  • Updated: Enhanced error handling for excludeChars option.
  • Fixed: Minor bug fixes and performance improvements.

Author

Vaibhav Kumar

Support

For support, you can contact me through my portfolio website or raise an issue on GitHub.