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

@capsuleer/chance

v1.0.1

Published

Random data generator for capsuleer — realistic fake names, addresses, emails, numbers, and more

Downloads

111

Readme

@capsuleer/chance

Random data generator for Capsuleer agents. Powered by Chance.js — generate realistic fake people, places, URLs, numbers, IDs, and more. Indispensable for seeding test databases, simulating user behaviour, and making demo data that doesn't look like "John Doe, [email protected], 123 Main St."

capsuleer install chance

API

Identity

await chance.name()                              // → "Lena Castillo"
await chance.name({ full: true, prefix: true })  // → "Dr. Marcus T. Webb"
await chance.email()                             // → "[email protected]"
await chance.email({ domain: "acme.com" })       // → "[email protected]"
await chance.phone()                             // → "(412) 555-0183"
await chance.age()                               // → 34
await chance.age({ type: "senior" })             // → 71
await chance.gender()                            // → "Female"
await chance.birthday()                          // → "1991-07-22"
await chance.birthday({ type: "teen" })          // → "2008-03-14"

Location

await chance.address()       // → "1842 Rokev Drive"
await chance.city()          // → "Gukbozuj"
await chance.country()       // → "NZ"
await chance.country({ full: true }) // → "New Zealand"
await chance.zip()           // → "84115"
await chance.coordinates()   // → { lat: -23.4821, lng: 140.2938 }

Internet

await chance.url()                                   // → "http://dum.gov/utuzpew"
await chance.url({ protocol: "https", domain: "acme.com" }) // → "https://acme.com/bivuv"
await chance.domain()                                // → "wekber.org"
await chance.ip()                                    // → "182.34.7.201"
await chance.ipv6()                                  // → "8cf4:22fb:..."
await chance.avatar()                                // → "https://www.gravatar.com/avatar/..."

Text

await chance.word()                     // → "hiwul"
await chance.sentence()                 // → "Odo wemjez re bop iwuwa tipu."
await chance.sentence({ words: 4 })     // → "Ku bafe nuv zoksi."
await chance.paragraph()                // → "Wifib alo re ..." (5 sentences)
await chance.paragraph({ sentences: 2 })

Numbers & IDs

await chance.integer()                   // → -2847361
await chance.integer({ min: 1, max: 100 }) // → 42
await chance.float({ min: 0, max: 1, fixed: 4 }) // → 0.7342
await chance.guid()   // → "f0d8368d-1234-4cfc-a6d9-bf5e8e5f5c84"
await chance.hash()   // → "b80bb7740288fda1724..."
await chance.hash({ length: 8 }) // → "a3f9b2c1"

Finance

await chance.cc()                  // → "4716184847393"  (Luhn-valid, not a real card)
await chance.cc({ type: "visa" })  // → "4539578763621486"
await chance.currency()            // → { code: "JPY", name: "Japanese Yen" }

Misc

await chance.company()              // → "Rocha, Bates and Nichols"
await chance.profession()           // → "Archaeologist"
await chance.animal()               // → "Impala"
await chance.animal({ type: "ocean" }) // → "Blue Whale"
await chance.color()                // → "#a3f29b"
await chance.color({ format: "rgb" }) // → "rgb(163,242,155)"
await chance.emoji()                // → "🦊"
await chance.timezone()             // → "America/Chicago"

Bulk generation

// Call any method N times and collect results
const names = await chance.n("name", 10)
// → ["Lena Castillo", "Marcus Webb", ...]

const emails = await chance.n("email", 5, { domain: "acme.com" })
// → ["[email protected]", "[email protected]", ...]

n() is the power move — generate a full fake dataset in one call, then pass it straight to sqlite.execute().


Observability

{ "ok": true, "op": "chance.name", "data": { "result": "Lena Castillo" } }
{ "ok": true, "op": "chance.email", "data": { "result": "[email protected]" } }
{ "ok": true, "op": "chance.n", "data": { "method": "name", "count": 10 } }

Policy

const capsule = await Capsule({
  policy: {
    chance: true  // all methods allowed — it's just random data
  }
})

See the policy docs for the full rule syntax.