{"_id":"@capsuleer/chance","name":"@capsuleer/chance","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@capsuleer/chance","version":"1.0.1","description":"Random data generator for capsuleer — realistic fake names, addresses, emails, numbers, and more","type":"module","main":"./index.ts","types":"./index.ts","keywords":["capsuleer","chance","faker","random","test-data"],"author":{"name":"cody"},"license":"MIT","dependencies":{"@capsuleer/core":"latest","chance":"^1.1.12"},"peerDependencies":{"bun":">=1.0.0"},"_id":"@capsuleer/chance@1.0.1","gitHead":"62489436240e28d42392ff4c70a0db16dc25793c","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-p5p942dBtVKC2lQX+vtcxLS/30bGHr2wlrSBIScIyJH8ACi3tGhkG3wAj4iigmWSsLgdQ4ciHyKn1Rl8o6ITyg==","shasum":"e9584062c46781ea6bb94e1125e50db22f8f427f","tarball":"https://registry.npmjs.org/@capsuleer/chance/-/chance-1.0.1.tgz","fileCount":4,"unpackedSize":33532,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCiJbiSXnC1q4Y7L9ScLP+YhHmBShO1akMj6GL+Vi7/BQIgRWIM7tVs8HtrM7M7PwSjXORt9c1y+mTP4FXuUt+nC/o="}]},"_npmUser":{"name":"codywakeford","email":"codypwakeford@gmail.com"},"directories":{},"maintainers":[{"name":"codywakeford","email":"codypwakeford@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chance_1.0.1_1773962435629_0.8045198840236512"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T23:20:35.568Z","1.0.1":"2026-03-19T23:20:35.771Z","modified":"2026-03-19T23:20:35.951Z"},"maintainers":[{"name":"codywakeford","email":"codypwakeford@gmail.com"}],"description":"Random data generator for capsuleer — realistic fake names, addresses, emails, numbers, and more","keywords":["capsuleer","chance","faker","random","test-data"],"author":{"name":"cody"},"license":"MIT","readme":"# @capsuleer/chance\n\nRandom data generator for Capsuleer agents. Powered by [Chance.js](https://chancejs.com) — 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, john@example.com, 123 Main St.\"\n\n```bash\ncapsuleer install chance\n```\n\n---\n\n## API\n\n### Identity\n\n```typescript\nawait chance.name()                              // → \"Lena Castillo\"\nawait chance.name({ full: true, prefix: true })  // → \"Dr. Marcus T. Webb\"\nawait chance.email()                             // → \"gavit@maflo.net\"\nawait chance.email({ domain: \"acme.com\" })       // → \"wubu@acme.com\"\nawait chance.phone()                             // → \"(412) 555-0183\"\nawait chance.age()                               // → 34\nawait chance.age({ type: \"senior\" })             // → 71\nawait chance.gender()                            // → \"Female\"\nawait chance.birthday()                          // → \"1991-07-22\"\nawait chance.birthday({ type: \"teen\" })          // → \"2008-03-14\"\n```\n\n### Location\n\n```typescript\nawait chance.address()       // → \"1842 Rokev Drive\"\nawait chance.city()          // → \"Gukbozuj\"\nawait chance.country()       // → \"NZ\"\nawait chance.country({ full: true }) // → \"New Zealand\"\nawait chance.zip()           // → \"84115\"\nawait chance.coordinates()   // → { lat: -23.4821, lng: 140.2938 }\n```\n\n### Internet\n\n```typescript\nawait chance.url()                                   // → \"http://dum.gov/utuzpew\"\nawait chance.url({ protocol: \"https\", domain: \"acme.com\" }) // → \"https://acme.com/bivuv\"\nawait chance.domain()                                // → \"wekber.org\"\nawait chance.ip()                                    // → \"182.34.7.201\"\nawait chance.ipv6()                                  // → \"8cf4:22fb:...\"\nawait chance.avatar()                                // → \"https://www.gravatar.com/avatar/...\"\n```\n\n### Text\n\n```typescript\nawait chance.word()                     // → \"hiwul\"\nawait chance.sentence()                 // → \"Odo wemjez re bop iwuwa tipu.\"\nawait chance.sentence({ words: 4 })     // → \"Ku bafe nuv zoksi.\"\nawait chance.paragraph()                // → \"Wifib alo re ...\" (5 sentences)\nawait chance.paragraph({ sentences: 2 })\n```\n\n### Numbers & IDs\n\n```typescript\nawait chance.integer()                   // → -2847361\nawait chance.integer({ min: 1, max: 100 }) // → 42\nawait chance.float({ min: 0, max: 1, fixed: 4 }) // → 0.7342\nawait chance.guid()   // → \"f0d8368d-1234-4cfc-a6d9-bf5e8e5f5c84\"\nawait chance.hash()   // → \"b80bb7740288fda1724...\"\nawait chance.hash({ length: 8 }) // → \"a3f9b2c1\"\n```\n\n### Finance\n\n```typescript\nawait chance.cc()                  // → \"4716184847393\"  (Luhn-valid, not a real card)\nawait chance.cc({ type: \"visa\" })  // → \"4539578763621486\"\nawait chance.currency()            // → { code: \"JPY\", name: \"Japanese Yen\" }\n```\n\n### Misc\n\n```typescript\nawait chance.company()              // → \"Rocha, Bates and Nichols\"\nawait chance.profession()           // → \"Archaeologist\"\nawait chance.animal()               // → \"Impala\"\nawait chance.animal({ type: \"ocean\" }) // → \"Blue Whale\"\nawait chance.color()                // → \"#a3f29b\"\nawait chance.color({ format: \"rgb\" }) // → \"rgb(163,242,155)\"\nawait chance.emoji()                // → \"🦊\"\nawait chance.timezone()             // → \"America/Chicago\"\n```\n\n### Bulk generation\n\n```typescript\n// Call any method N times and collect results\nconst names = await chance.n(\"name\", 10)\n// → [\"Lena Castillo\", \"Marcus Webb\", ...]\n\nconst emails = await chance.n(\"email\", 5, { domain: \"acme.com\" })\n// → [\"wubu@acme.com\", \"tiva@acme.com\", ...]\n```\n\n`n()` is the power move — generate a full fake dataset in one call, then pass it straight to `sqlite.execute()`.\n\n---\n\n## Observability\n\n```jsonl\n{ \"ok\": true, \"op\": \"chance.name\", \"data\": { \"result\": \"Lena Castillo\" } }\n{ \"ok\": true, \"op\": \"chance.email\", \"data\": { \"result\": \"gavit@maflo.net\" } }\n{ \"ok\": true, \"op\": \"chance.n\", \"data\": { \"method\": \"name\", \"count\": 10 } }\n```\n\n---\n\n## Policy\n\n```typescript\nconst capsule = await Capsule({\n  policy: {\n    chance: true  // all methods allowed — it's just random data\n  }\n})\n```\n\nSee the [policy docs](https://axon.arclabs.it/docs/capsuleer/policy) for the full rule syntax.\n","readmeFilename":"README.md","_rev":"1-ef906270583d6841c6427678fa800d2a"}