{"id":16399167,"url":"https://github.com/alextes/vegas","last_synced_at":"2026-04-29T19:07:08.007Z","repository":{"id":62422124,"uuid":"375364621","full_name":"alextes/vegas","owner":"alextes","description":"Vegas helps generate numbers or pick elements based on randomness.","archived":false,"fork":false,"pushed_at":"2021-07-07T14:59:02.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-05T20:39:23.681Z","etag":null,"topics":["deno","deno-module","denoland","random","random-generation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alextes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-09T13:26:37.000Z","updated_at":"2023-02-22T18:15:27.000Z","dependencies_parsed_at":"2022-11-01T17:31:25.118Z","dependency_job_id":null,"html_url":"https://github.com/alextes/vegas","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/alextes/vegas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextes%2Fvegas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextes%2Fvegas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextes%2Fvegas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextes%2Fvegas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextes","download_url":"https://codeload.github.com/alextes/vegas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextes%2Fvegas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32439399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","deno-module","denoland","random","random-generation"],"created_at":"2024-10-11T05:23:14.047Z","updated_at":"2026-04-29T19:07:07.980Z","avatar_url":"https://github.com/alextes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003c!-- \u003cimg src=\"https://raw.githubusercontent.com/alextes/vegas/master/media/vegas-logo.svg\" width=\"200\"\u003e --\u003e\n\n\u003ch1 align=\"center\"\u003eVegas\u003c/h1\u003e\n\u003cp align=\"center\"\u003eGenerate random numbers and samples.\u003c/p\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/alextes/vegas/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/v/tag/alextes/vegas?label=version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/alextes/vegas/actions/workflows/tests.yml\"\u003e\n    \u003cimg src=\"https://github.com/alextes/vegas/workflows/tests/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://doc.deno.land/https/deno.land/x/vegas/mod.ts\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/%E2%80%8E-docs-blue.svg?logo=deno\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/alextes/vegas\"\u003e\n    \u003cimg src=\"https://codecov.io/gh/alextes/vegas/branch/main/graph/badge.svg?token=TW4QNAKP7U\"/\u003e\n  \u003c/a\u003e\n  \u003cimg alt=\"dependency count\" src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fdep-count%2Fhttps%2Fdeno.land%2Fx%2Fvegas%2Fmod.ts\"\u003e\n  \u003cimg alt=\"dependencies up-to-date\" src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fupdates%2Fhttps%2Fdeno.land%2Fx%2Fvegas%2Fmod.ts\"\u003e\n\u003c/p\u003e\n\nVegas helps do things based on randomness. For example picking a random integer,\npicking a random element from a list, or even collecting a unique sample of\nelements from a list. This library takes inspiration from\n[Python's random library](https://docs.python.org/3/library/random.html).\n\n## Usage\n\n```ts\nimport { randomInt } from \"https://deno.land/x/vegas@1.0.0/mod.ts\";\n\nconsole.log(randomInt(0, 4)); // 2\n```\n\n## API\n\nBelow are examples for all currently available APIs. Except for the\n`makeGenerators` and `makeSeededGenerators` functions, all functions draw\nrandomness from `Math.random`. Use the aforementioned functions to draw\nrandomness from a different source.\n\n```ts\n// int from and including two, up to and excluding eight.\nrandomInt(2, 8);\n\n// int below 4.\nrandomBelow(4);\n\n// pick a random element from a list.\nrandomPick([1, 2, 3]);\n\n// pick a sample of two elements from a list.\nrandomSample([1, 2, 3, 4], 2);\n\n// random float, mostly here for seeded random float generation.\nrandomFloat();\n\n// initializes all random generators with a seeded random number generator.\nconst vegas = makeSeededGenerators(\"my-seed\");\nvegas.randomInt(2, 32);\n\n// initializes all random generators with a custom random number generator.\nconst vegasCustom = makeGenerators(Math.random);\nvegasCustom.randomInt(0, 10);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextes%2Fvegas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextes%2Fvegas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextes%2Fvegas/lists"}