{"id":23392047,"url":"https://github.com/evilkiwi/astar","last_synced_at":"2025-04-11T10:21:23.999Z","repository":{"id":57146455,"uuid":"448166913","full_name":"evilkiwi/astar","owner":"evilkiwi","description":"Synchronous A* pathfinding for TypeScript","archived":false,"fork":false,"pushed_at":"2023-11-11T08:54:01.000Z","size":1179,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-09T04:07:08.116Z","etag":null,"topics":["astar-algorithm","grid","javascript","pathfinding","typescript"],"latest_commit_sha":null,"homepage":"https://evil.kiwi","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evilkiwi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"evilkiwi"}},"created_at":"2022-01-15T03:00:44.000Z","updated_at":"2024-05-17T13:28:59.000Z","dependencies_parsed_at":"2023-01-26T23:55:12.081Z","dependency_job_id":null,"html_url":"https://github.com/evilkiwi/astar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilkiwi%2Fastar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilkiwi%2Fastar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilkiwi%2Fastar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evilkiwi%2Fastar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evilkiwi","download_url":"https://codeload.github.com/evilkiwi/astar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230793609,"owners_count":18281091,"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","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":["astar-algorithm","grid","javascript","pathfinding","typescript"],"created_at":"2024-12-22T04:28:15.750Z","updated_at":"2024-12-22T04:28:16.262Z","avatar_url":"https://github.com/evilkiwi.png","language":"TypeScript","funding_links":["https://github.com/sponsors/evilkiwi"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@evilkiwi/astar\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@evilkiwi/astar?style=flat-square\" alt=\"NPM\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/3S6AKZ2GR9\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/discord/1000565079789535324?color=7289DA\u0026label=discord\u0026logo=discord\u0026logoColor=FFFFFF\u0026style=flat-square\" alt=\"Discord\" /\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/npm/l/@evilkiwi/astar?style=flat-square\" alt=\"GPL-3.0-only\" /\u003e\n  \u003ch3\u003eSynchronous A* pathfinding for TypeScript\u003c/h3\u003e\n\u003c/div\u003e\n\n`@evilkiwi/astar` is an synchronous A* pathfinding implementation in TypeScript.\n\n- Supports diagonal or manhattan heuristics\n- Optionally supports 3-dimensional grids with elevation\n- Highly configurable (corner cutting, diagonal movement, etc.)\n- First-class TypeScript\n- Fully tested\n- It's not awfully performant, but it works!\n\n## Installation\n\nThis package is available via NPM:\n\n```bash\nyarn add @evilkiwi/astar\n\n# or\n\nnpm install @evilkiwi/astar\n```\n\n## Usage\n\n```typescript\nimport { search, type Grid } from '@evilkiwi/astar';\n\n/**\n * The first step is to have a Grid.\n *\n * -1 = un-walkable, like a wall or water.\n *  0 = walkable, optionally any integer above 0 for elevation support\n */\nconst grid: Grid = [\n  [ 0,  5, -1,  0,  0, -1,  0,  0],\n  [ 0,  4, -1,  0,  0, -1,  0,  0],\n  [ 0,  3, -1,  0,  0, -1,  0,  0],\n  [ 0,  2, -1,  0,  0,  0,  0,  0],\n  [ 0,  1, -1,  0,  0, -1,  0,  0],\n  [ 0,  0, -1,  0,  0, -1,  0,  0],\n  [ 0,  0,  0,  0,  0, -1,  0,  0],\n  [ 0,  0, -1,  0,  0, -1,  0,  0],\n];\n\n/**\n * Once you have a Grid, you can find an efficient tile-based path\n * from one vector to another.\n */\nconst path = search({\n  cutCorners: false,\n  diagonal: true,\n  from: [0, 0],\n  to: [7, 6],\n  grid,\n});\n\n// Path is either an array of vectors or null (could not find a path)\nconsole.log(path);\n```\n\nThe library is immutable/side-effect free, and the grid reference won't be changed when searched.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilkiwi%2Fastar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilkiwi%2Fastar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilkiwi%2Fastar/lists"}