{"id":19042055,"url":"https://github.com/writetome51/array-get-adjacent-at","last_synced_at":"2026-06-19T08:02:00.563Z","repository":{"id":122062329,"uuid":"153050727","full_name":"writetome51/array-get-adjacent-at","owner":"writetome51","description":"Function returns chosen number of adjacent items in array beginning at chosen index","archived":false,"fork":false,"pushed_at":"2021-11-03T04:02:59.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T21:31:33.330Z","etag":null,"topics":["array-function","array-manipulations","get","items","javascript","typescript"],"latest_commit_sha":null,"homepage":"","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/writetome51.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-15T03:57:02.000Z","updated_at":"2021-11-03T04:03:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"a07334c2-d376-4e8b-bc16-7e4d3debe883","html_url":"https://github.com/writetome51/array-get-adjacent-at","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/writetome51/array-get-adjacent-at","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-adjacent-at","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-adjacent-at/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-adjacent-at/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-adjacent-at/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/array-get-adjacent-at/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-adjacent-at/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34522042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","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":["array-function","array-manipulations","get","items","javascript","typescript"],"created_at":"2024-11-08T22:34:18.277Z","updated_at":"2026-06-19T08:02:00.542Z","avatar_url":"https://github.com/writetome51.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getAdjacentAt\\\u003cT\\\u003e(\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;startingIndex: number,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;howMany: number,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;array: T[]\u003cbr\u003e): T[]\n\nBeginning at `startingIndex`, returns `howMany` adjacent items from `array`.  \nDoes not modify `array`.  `startingIndex` can be negative or positive.  \nIntended as a replacement of Array.prototype.slice() .  It strictly validates args.\n\n\n## Examples\n```js\nlet arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\ngetAdjacentAt(0, 3, arr);\n// --\u003e [1,2,3]\n\ngetAdjacentAt(2, 5, arr);\n// --\u003e [3,4,5,6,7]\n\n// You can pass a negative index:\ngetAdjacentAt(-3, 2, arr);\n// --\u003e [8, 9]\n\ngetAdjacentAt(-2, 3, arr); // Requesting one too may items\n//Error: 'the array does not have enough items to fulfill your request'\n```\n\n## Installation\n`npm i  @writetome51/array-get-adjacent-at`\n\n## Loading\n```js\nimport { getAdjacentAt } from '@writetome51/array-get-adjacent-at';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-adjacent-at","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Farray-get-adjacent-at","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-adjacent-at/lists"}