{"_id":"2d-grid-neighbors","_rev":"2-d7a9b621e04ba569aa020fd0d0d7b475","name":"2d-grid-neighbors","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"2d-grid-neighbors","version":"1.0.0","author":{"name":"Alexander Schaller"},"license":"MIT","_id":"2d-grid-neighbors@1.0.0","maintainers":[{"name":"alexanderschaller","email":"corteo@live.com"}],"homepage":"https://github.com/AlexanderSchaller/2d-array-neighbors#readme","bugs":{"url":"https://github.com/AlexanderSchaller/2d-array-neighbors/issues"},"dist":{"shasum":"2b9f53bce40b7759745672fc798e2b935a1a2a2b","tarball":"https://registry.npmjs.org/2d-grid-neighbors/-/2d-grid-neighbors-1.0.0.tgz","fileCount":14,"integrity":"sha512-RxoKmTmXJIdJvzdZkvyARJM6L/nfnwOOs7bg00nPdLVD9A9Le7X4swoK9xMp7LtfqifsPcFzC3Y96iRjE1rFRQ==","signatures":[{"sig":"MEQCIE/qCqZj67uq/3E3vsjZktaLp5myIO/2IZdzxaraqWGMAiARvwl69EesP+N6BgW2VhUbR63RT1dWwjB+S3IJ8G1lBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13457},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"5b8994c767d308695200ccc9c0b00bf64a41f497","scripts":{"ci":"npm run build","test":"tsc && NODE_OPTIONS=--experimental-vm-modules jest --verbose","build":"tsc"},"_npmUser":{"name":"alexanderschaller","email":"corteo@live.com"},"repository":{"url":"git+https://github.com/AlexanderSchaller/2d-array-neighbors.git","type":"git"},"_npmVersion":"10.8.2","description":"A library to get the values of neighbors of a grid as represented in a 2D array","directories":{},"_nodeVersion":"22.5.1","_hasShrinkwrap":false,"devDependencies":{"ts-jest":"^29.2.5","typescript":"^5.6.3","@jest/globals":"^29.7.0","@babel/preset-typescript":"^7.25.7"},"_npmOperationalInternal":{"tmp":"tmp/2d-grid-neighbors_1.0.0_1729602547099_0.39358295167675816","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"2d-grid-neighbors","version":"1.0.1","author":{"name":"Alexander Schaller"},"license":"MIT","_id":"2d-grid-neighbors@1.0.1","maintainers":[{"name":"alexanderschaller","email":"corteo@live.com"}],"homepage":"https://github.com/AlexanderSchaller/2d-array-neighbors#readme","bugs":{"url":"https://github.com/AlexanderSchaller/2d-array-neighbors/issues"},"dist":{"shasum":"1b4997869b73e5c71702dcb898f65db8d4bc6fb1","tarball":"https://registry.npmjs.org/2d-grid-neighbors/-/2d-grid-neighbors-1.0.1.tgz","fileCount":14,"integrity":"sha512-4qBKOtvos8Fjk7OOHZjqWjmd7BwvmsKB+mhfn7jF3LNoyrPwiotCxDXI3UHpZQcDfKM1qd4Q15pu859khS3YxA==","signatures":[{"sig":"MEUCIH+mZyuZPZCBIV8saG6EfTsbE2gZDMY7lLhcAgBvSpTMAiEAwRC01N94KniWcYBiqP1DMGbgeUoDf2SEmZkwRBsQAKM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13673},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"508f95281c9df1c1ec5ec7f6e5862d613dffd836","scripts":{"ci":"npm run build","test":"tsc && NODE_OPTIONS=--experimental-vm-modules jest --verbose","build":"tsc"},"_npmUser":{"name":"alexanderschaller","email":"corteo@live.com"},"repository":{"url":"git+https://github.com/AlexanderSchaller/2d-array-neighbors.git","type":"git"},"_npmVersion":"10.8.2","description":"A library to get the values of neighbors of a grid as represented in a 2D array","directories":{},"_nodeVersion":"22.5.1","_hasShrinkwrap":false,"devDependencies":{"ts-jest":"^29.2.5","typescript":"^5.6.3","@jest/globals":"^29.7.0","@babel/preset-typescript":"^7.25.7"},"_npmOperationalInternal":{"tmp":"tmp/2d-grid-neighbors_1.0.1_1729602651410_0.5333313956528283","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"2d-grid-neighbors","version":"1.0.2","description":"A library to get the values of neighbors of a grid as represented in a 2D array","main":"dist/index.js","scripts":{"build":"tsc","test":"tsc && NODE_OPTIONS=--experimental-vm-modules jest --verbose","ci":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/AlexanderSchaller/2d-array-neighbors.git"},"author":{"name":"Alexander Schaller"},"license":"MIT","bugs":{"url":"https://github.com/AlexanderSchaller/2d-array-neighbors/issues"},"homepage":"https://github.com/AlexanderSchaller/2d-array-neighbors#readme","devDependencies":{"@babel/preset-typescript":"^7.25.7","@jest/globals":"^29.7.0","ts-jest":"^29.2.5","typescript":"^5.6.3"},"type":"module","_id":"2d-grid-neighbors@1.0.2","gitHead":"e79b81f64f2e36789b7b41d6b4b752bbcddcd251","types":"./dist/index.d.ts","_nodeVersion":"22.5.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-zs14XANPDGtFsQaEAtcTPhC+ibWMpKVm1n1DqD7K3igzt/QUYJpa0iRKLH6sX68NmbWbghKP/eo+UsctbgMC4A==","shasum":"a8c9ff0f3c7dbaa09e869c1ea873d8b3e9d71757","tarball":"https://registry.npmjs.org/2d-grid-neighbors/-/2d-grid-neighbors-1.0.2.tgz","fileCount":14,"unpackedSize":13682,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAOurJoc7UTOrkqG5NSbcPhBNW+5QKcKJl764gUtNBngIhAKs+XKDTO+2vnzPIYpo7ccVz2kHCIt1HVgoJuWwLADvC"}]},"_npmUser":{"name":"alexanderschaller","email":"corteo@live.com"},"directories":{},"maintainers":[{"name":"alexanderschaller","email":"corteo@live.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/2d-grid-neighbors_1.0.2_1729604890108_0.46160837999214555"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-22T13:09:07.098Z","modified":"2024-10-22T13:48:10.440Z","1.0.0":"2024-10-22T13:09:07.349Z","1.0.1":"2024-10-22T13:10:51.565Z","1.0.2":"2024-10-22T13:48:10.273Z"},"bugs":{"url":"https://github.com/AlexanderSchaller/2d-array-neighbors/issues"},"author":{"name":"Alexander Schaller"},"license":"MIT","homepage":"https://github.com/AlexanderSchaller/2d-array-neighbors#readme","repository":{"type":"git","url":"git+https://github.com/AlexanderSchaller/2d-array-neighbors.git"},"description":"A library to get the values of neighbors of a grid as represented in a 2D array","maintainers":[{"name":"alexanderschaller","email":"corteo@live.com"}],"readme":"# Grid neighbor finder\n\nLibrary returns the neighbors of a grid represented as a 2D array **without** wrapping.\n\n## Installing\n```\nnpm i 2d-grid-neighbors\n```\n\n## Usage\n\nGetting the **values** of the neighbors:\n```typescript\nconst grid = [\n    'a', 'b', 'c', 'd',\n    'd', 'e', 'f', 'g',\n    'h', 'i', 'j', 'k',\n    'l', 'm', 'n', '0',\n];\n\nconst getNeighborsForIndex = 5;\nconst result = getNeighbors(grid, getNeighborsForIndex);\n\n// result: ['a', 'b', 'c', 'd', 'f', 'h', 'i', 'j']\n```\n\nIf you need the indices, use ``getNeighborIndices()``.\n\nThis library works for a grid of any size provided that the grid has an equal number of columns and rows.\n","readmeFilename":"README.md"}