{"id":36544920,"url":"https://github.com/aleiva17/heap-happens","last_synced_at":"2026-01-12T05:58:33.307Z","repository":{"id":215693744,"uuid":"739585318","full_name":"aleiva17/heap-happens","owner":"aleiva17","description":"Simple, flexible, and performant implementation of the heap data structure.","archived":false,"fork":false,"pushed_at":"2024-01-07T18:11:15.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T04:33:48.693Z","etag":null,"topics":["data-structures","heap","heapsort","js-library","library","priority-queue","ts-library"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/heap-happens","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleiva17.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2024-01-05T23:38:48.000Z","updated_at":"2024-01-16T12:15:00.000Z","dependencies_parsed_at":"2024-01-13T16:44:16.381Z","dependency_job_id":"719e9686-b67e-4473-9699-00a05f04dad3","html_url":"https://github.com/aleiva17/heap-happens","commit_stats":null,"previous_names":["aleiva17/heap-happens"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aleiva17/heap-happens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleiva17%2Fheap-happens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleiva17%2Fheap-happens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleiva17%2Fheap-happens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleiva17%2Fheap-happens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleiva17","download_url":"https://codeload.github.com/aleiva17/heap-happens/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleiva17%2Fheap-happens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28335987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"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":["data-structures","heap","heapsort","js-library","library","priority-queue","ts-library"],"created_at":"2026-01-12T05:58:32.569Z","updated_at":"2026-01-12T05:58:33.302Z","avatar_url":"https://github.com/aleiva17.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Heap happens\n\nNeed a fast and efficient heap/priority queue in your JavaScript/TypeScript projects? Look no further!\n\nThis package offers a simple, flexible, and performant implementation of the Heap data structure, ready to tackle your most demanding tasks.\n\n## Examples\n\nPush, top and change higher priority comparator method.\n\n```ts\nconst heap = new Heap\u003cnumber\u003e();\n\nheap.push(404);\nheap.push(200);\nheap.push(500);\n\nconsole.log(heap.top()); // 500\nheap.changeHigherPriorityComparator((a, b) =\u003e a \u003c b);\nconsole.log(heap.top()); // 200\n```\n\nDefault custom comparator and toSortedArray method.\n\n```ts\nconst heap = new Heap\u003cProfile\u003e({\n  comparator: (a, b) =\u003e a.points \u003e b.points\n  // if a.points is greater than b.points, then 'a' has higher priority\n});\n\nheap.push({ name: \"Avi\", points: 500 });\nheap.push({ name: \"Foo\", points: 900 });\nheap.push({ name: \"Bar\", points: 700 });\n\nconsole.log(heap.top()); // { name: \"Foo\", points: 900 }\nconsole.log(heap.toSortedArray(profile =\u003e profile.name)); // [\"Foo\", \"Bar\", \"Avi\"]\n```\n\n## Docs\n\nFor better examples and details about the methods and good practices, please see the following [documentation](https://github.com/aleiva17/heap-happens/blob/master/docs.md).\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'feat: add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\nDistributed under the MIT License. See `LICENSE.txt` for more information.\n\n## Contact\nAleiva - [@aleiva17](https://github.com/aleiva17) - aleiva1700@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleiva17%2Fheap-happens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleiva17%2Fheap-happens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleiva17%2Fheap-happens/lists"}