{"id":32821270,"url":"https://github.com/tabone/mendelian","last_synced_at":"2025-11-07T14:07:22.557Z","repository":{"id":231789410,"uuid":"776127464","full_name":"tabone/mendelian","owner":"tabone","description":"An NPM Module used to simulate genetic inheritance using Mendelian inheritance","archived":false,"fork":false,"pushed_at":"2024-04-08T19:45:05.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-12T13:57:15.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tabone.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-22T18:27:51.000Z","updated_at":"2024-04-09T05:01:41.000Z","dependencies_parsed_at":"2024-04-06T00:25:09.300Z","dependency_job_id":"d4cf588e-8f2e-425c-8020-24e36705d8fd","html_url":"https://github.com/tabone/mendelian","commit_stats":null,"previous_names":["tabone/mendelian"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tabone/mendelian","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabone%2Fmendelian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabone%2Fmendelian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabone%2Fmendelian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabone%2Fmendelian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tabone","download_url":"https://codeload.github.com/tabone/mendelian/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tabone%2Fmendelian/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283198158,"owners_count":26796041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-07T02:00:06.343Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-11-07T14:05:43.986Z","updated_at":"2025-11-07T14:07:22.550Z","avatar_url":"https://github.com/tabone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003emendelian\u003c/h1\u003e\n\n  \u003cbr /\u003e\n\n  \u003cimg width=\"500\" alt=\"Logo\" src=\"https://i.imgur.com/Ul6YE78.png\"\u003e\n\n  \u003chr /\u003e\n\u003c/div\u003e\n\nThis package provides functionality for simulating genetic inheritance in creatures using [Mendelian inheritance](https://en.wikipedia.org/wiki/Mendelian_inheritance) principles. It facilitates the creation of genes, genotypes, and creatures with customizable genetic properties.\n\n## Installation\n\nYou can install the package via npm:\n\n```bash\nyarn add mendelian\n```\n\n## Usage\n\n### Creating a new seeded `Genetics` instance\n\n```javascript\nimport { Genetics } from \"mendelian\";\n\nconst genetics = new Genetics({ seed: \"idrinkandiknowthings\" });\n```\n\n### Creating `Gene`s\n\n```javascript\nconst blueEye = genetics.createAllele({\n  trait: \"eye-color\",\n  dominance: 3,\n  description: \"blue\",\n});\n\nconst greenEye = genetics.createAllele({\n  trait: \"eye-color\",\n  dominance: 5,\n  description: \"green\",\n});\n\nconst brownEye = genetics.createAllele({\n  trait: \"eye-color\",\n  dominance: 8,\n  description: \"brown\",\n});\n```\n\n### Creating `Creature`s with `Gene`s\n\n```javascript\nconst creatureOne = genetics.createCreature({\n  genes: {\n    eye: genetics.createGene({\n      trait: \"eye-color\",\n      alleles: [brownEye, blueEye],\n    }),\n  },\n});\n\nconst creatureTwo = genetics.createCreature({\n  genes: {\n    eye: genetics.createGene({\n      trait: \"eye-color\",\n      alleles: [brownEye, blueEye],\n    }),\n  },\n});\n```\n\n### Reproducing a child\n\n```javascript\nconsole.log(creatureOne.mate(creatureTwo).genes.eye.phenotype.description); // =\u003e brown\n```\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg width=\"500\" alt=\"Demo\" src=\"https://i.imgur.com/lJ68rlz.png\"\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabone%2Fmendelian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftabone%2Fmendelian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftabone%2Fmendelian/lists"}