{"id":20596090,"url":"https://github.com/davidfig/vec2-recycle","last_synced_at":"2025-06-12T15:04:54.435Z","repository":{"id":44018856,"uuid":"231730107","full_name":"davidfig/vec2-recycle","owner":"davidfig","description":"another vanilla vec-2 library with recycling","archived":false,"fork":false,"pushed_at":"2023-01-05T04:51:56.000Z","size":1264,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T15:16:35.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/davidfig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-04T08:09:35.000Z","updated_at":"2020-01-06T23:09:21.000Z","dependencies_parsed_at":"2023-02-03T10:30:17.833Z","dependency_job_id":null,"html_url":"https://github.com/davidfig/vec2-recycle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/davidfig/vec2-recycle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fvec2-recycle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fvec2-recycle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fvec2-recycle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fvec2-recycle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidfig","download_url":"https://codeload.github.com/davidfig/vec2-recycle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidfig%2Fvec2-recycle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259490399,"owners_count":22865761,"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":[],"created_at":"2024-11-16T08:15:06.698Z","updated_at":"2025-06-12T15:04:54.413Z","avatar_url":"https://github.com/davidfig.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vec2-recycle\r\nAnother vanilla vector 2 library with recycling\r\n\r\nSimilar in scope (and based on) https://github.com/tmpvar/vec2.js. Differences:\r\n\r\n* uses a cache to recycle vectors to minimize garbage collection\r\n* uses a number[2] without any prototypes\r\n* is not watchable (unlike the above library--removed for speed purposes)\r\n\r\n## Simple Example\r\n```js\r\nimport * as vec2 from 'vec2-recycle'\r\n\r\nconst v1 = vec2.create(5, 4)\r\nconst v2 = vec2.create(8, 9)\r\n\r\n// copies to a new vector\r\nconst v3 = vec2.add(v1, v2, true)\r\n\r\n// v1 is replaced\r\nvec2.subtract(v1, v2)\r\n\r\nvec2.recycle(v2)\r\n```\r\n\r\n## API Documentation\r\n[https://davidfig.github.io/vec2-recycle/jsdoc/](https://davidfig.github.io/vec2-recycle/)\r\n\r\n## Installation\r\n\r\n    yarn add vec2-recycle\r\nor\r\n\r\n    npm i vec2-recycle\r\n  \r\n## Tests\r\n\r\n1. Clone repository\r\n2. yarn install\r\n3. yarn test (for jest test code)\r\n\r\n## Other Libraries\r\nIf you liked pixi-viewport, please try my other open source libraries:\r\n* [pixi-scrollbox](https://github.com/davidfig/pixi-scrollbox) - pixi.js scrollbox: a masked box that can scroll vertically or horizontally with scrollbars (uses pixi-viewport)\r\n* [pixi-ease](https://github.com/davidfig/pixi-ease) - pixi.js animation library using easing functions\r\n* [intersects](https://github.com/davidfig/intersects) - a simple collection of 2d collision/intersects functions. Supports points, circles, lines, axis-aligned boxes, and polygons\r\n\r\n## license  \r\nMIT License  \r\n(c) 2020 [YOPEY YOPEY LLC](https://yopeyopey.com/) by [David Figatner](https://twitter.com/yopey_yopey/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Fvec2-recycle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidfig%2Fvec2-recycle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidfig%2Fvec2-recycle/lists"}