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

@se-oss/rand

v1.1.0

Published

A utility library for generating random strings, numbers and UUIDs.

Downloads

98

Readme

@se-oss/rand

CI NPM Version MIT License Install Size

This library provides functions for generating random strings and numbers in various formats, including Base10, Base36, Base62, UUIDv4, and random numbers within specified ranges or lengths.


📦 Installation

pnpm i @se-oss/rand

📖 Usage

import * as rnd from '@se-oss/rand';

// Generate a random Base62 string of length 12
console.log(rnd.randomBase62(12)); // Example output: 'A1b2C3d4E5f6'

// Generate a random Base36 string of length 8
console.log(rnd.randomBase36(8)); // Example output: '1a2b3c4d'

// Generate a random Base10 string of length 4
console.log(rnd.randomBase10(4)); // Example output: '5678'

// Generate a random UUIDv4 string
console.log(rnd.randomUuidv4()); // Example output: 'f81d4fae-7dec-11d0-a765-00a0c91e6bf6'

// Generate a random number between 1 and 10
console.log(rnd.randomNumber(1, 10)); // Example output: 5

// Generate a random number of length 16
console.log(rnd.randomNumber(16)); // Example output: 8933580352864351

📚 Documentation

For all configuration options, please see the API docs.

API
// Generates a random string of a specified length using the provided characters.
function random(chars: string, length: number): string;

// Generates a random string of a specified length using Base62 characters (A-Z, a-z, 0-9).
function randomBase62(length: number): string;

// Generates a random string of a specified length using Base36 characters (a-z, 0-9).
function randomBase36(length: number): string;

// Generates a random string of a specified length using Base10 characters (0-9).
function randomBase10(length: number): string;

// Generates a random UUIDv4 string.
function randomUuidv4(): string;

// Generates a random number within a specified range or of a specified length.
function randomNumber(min: number, max: number): number;
function randomNumber(length: number): number;

🤝 Contributing

Want to contribute? Awesome! To show your support is to star the project, or to raise issues on GitHub.

Thanks again for your support, it is much appreciated! 🙏

License

MIT © Shahrad Elahi and contributors.