{"_id":"@4bitlabs/vector","_rev":"8-ea2f54d3d69e40c07a3e3f5b75b0abc6","name":"@4bitlabs/vector","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"@4bitlabs/vector","version":"0.1.0","keywords":["data structures","typedarray","vector"],"author":{"name":"J. Holmes","email":"32bitkid@gmail.com"},"license":"ISC","_id":"@4bitlabs/vector@0.1.0","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"dist":{"shasum":"f490006bfbac6821c997bde3ba8622e226fc0f12","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-0.1.0.tgz","fileCount":19,"integrity":"sha512-O5kABWJB3z8LjsWLzvtxn+LG5l29kJBG/KyWdvrgRDf43twDKinMRPSeA5pZi2MRHp/eQt2nVwHV/KN0+eaJAQ==","signatures":[{"sig":"MEYCIQD/TiSpmkJqGBIKjRDkp+Tl1Xw94GFLztQtb0Fx/Olj5wIhAO1DZsm8mGVhtrDunWu7CQUQLyCagxLHyoYnAMufPwYl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18199},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"63789feb71d933534bad8596f35cfc1f591f30fd","scripts":{"test":"jest src/","build":"tsc --build","clean":"tsc --build --clean","prepack":"npm run build","clean:wipe":"rimraf ./dist"},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"_npmVersion":"10.5.0","description":"A TypedArray-backed resizable vector data-structure","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vector_0.1.0_1720996300568_0.13666292193619967","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@4bitlabs/vector","version":"0.1.1","keywords":["data structures","typedarray","vector"],"author":"J. Holmes <32bitkid@gmail.com>","license":"ISC","_id":"@4bitlabs/vector@0.1.1","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"dist":{"shasum":"cd4f25e673d8657d84ead22fd30ca95cc47e1a3d","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-0.1.1.tgz","fileCount":19,"integrity":"sha512-YmFGr9Z5TcQMTkr3sY0l5qPVN7ej3sDp31eHf3Jo8+BmPtCumpdrSKiikP6f0lXQ+Kbpa4moSnghKWEtzahquw==","signatures":[{"sig":"MEUCIDcLYOLS39M2jhm+T8FkhnZnAdBsKtRHDcyMcormEBFoAiEAlWLJq5b9l8DK1g76A/0v4MenTqQK+SCFPE0vAiV78ts=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18519},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"5905f9410eff2aa2dad3d5ac16143b6b4acf958f","scripts":{"test":"jest src/","build":"tsc --build","clean":"tsc --build --clean","prepack":"npm run build","clean:wipe":"rimraf ./dist"},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"_npmVersion":"lerna/8.1.6/node@v18.18.2+arm64 (darwin)","description":"A TypedArray-backed resizable vector data-structure","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vector_0.1.1_1721008069197_0.20810647324277465","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"@4bitlabs/vector","version":"0.1.2","keywords":["data structures","typedarray","vector"],"author":"J. Holmes <32bitkid@gmail.com>","license":"ISC","_id":"@4bitlabs/vector@0.1.2","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"homepage":"https://github.com/32bitkid/4bitlabs.spatial/tree/main/libs/vector","bugs":"https://github.com/32bitkid/4bitlabs.spatial/issues","dist":{"shasum":"da3d8541e990548c371e73917d5666285108af48","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-0.1.2.tgz","fileCount":19,"integrity":"sha512-FHhHovTffKbMx19y6M+vbkYwIrbIU1aq2sKmYsjbEvaWaNHJBgYm/ExDmXwZxgwnKIVj9JeHsUMC+wKPCA1/vg==","signatures":[{"sig":"MEYCIQCXqcMEc7nwsU8mWbpM/lO2YC7h+iBSGbw5TNmW06sFfgIhAOHaTgnZKiRgPBzWIwt6fK/nKa33+Y1L0PzCs+gGLarE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":18720},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"ef7aaaebb334b226b099c8d54a938f08d11bf447","scripts":{"test":"jest src/","build":"tsc --build","clean":"tsc --build --clean","prepack":"npm run build","clean:wipe":"rimraf ./dist"},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"repository":"github:32bitkid/4bitlabs.spatial","_npmVersion":"lerna/8.1.6/node@v18.18.2+arm64 (darwin)","description":"A TypedArray-backed resizable vector data-structure","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vector_0.1.2_1721050940945_0.46498705811052554","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@4bitlabs/vector","version":"0.2.0","keywords":["data structures","typedarray","vector"],"author":"J. Holmes <32bitkid@gmail.com>","license":"ISC","_id":"@4bitlabs/vector@0.2.0","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"homepage":"https://github.com/32bitkid/4bitlabs.spatial/tree/main/libs/vector","bugs":"https://github.com/32bitkid/4bitlabs.spatial/issues","dist":{"shasum":"6ead7bf08d7f6691930e052acbe0c49184c73e41","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-0.2.0.tgz","fileCount":27,"integrity":"sha512-CfEcoFerqws5hYzW7z8HsfOIiBIno0309pJD7x7846pPJr4Drdyu0O+fl1pjDggxpkXhGmyWOi1yQCdwKeXgqA==","signatures":[{"sig":"MEYCIQD0RuL9S0I438NpvEYf0WLOjbjDbQC43RiuVuReTUFEqgIhALrziEKAskTWg3Uu9ki4OLfzK++/+e6YvxEGRQEXZyGD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53619},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"93c6c7664155c825e0a3a89c86c539af69165d4e","scripts":{"docs":"typedoc --options ./typedoc.json","test":"jest src/","build":"tsc --build","clean":"tsc --build --clean","prepack":"npm run build","clean:wipe":"rimraf ./dist"},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"repository":{"url":"git+https://github.com/32bitkid/4bitlabs.spatial.git","type":"git"},"_npmVersion":"lerna/8.1.6/node@v20.15.1+arm64 (darwin)","description":"A simple, TypedArray-backed resizable vector data-structure","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vector_0.2.0_1721790586015_0.2183675023598417","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"@4bitlabs/vector","version":"0.2.1","keywords":["data structures","typedarray","vector","bigint"],"author":"J. Holmes <32bitkid@gmail.com>","license":"ISC","_id":"@4bitlabs/vector@0.2.1","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"homepage":"https://32bitkid.github.io/4bitlabs.spatial/modules/_4bitlabs_vector.html","bugs":"https://github.com/32bitkid/4bitlabs.spatial/issues","dist":{"shasum":"a4fa8a3af7d9b29cac54ea6e819c20633f5b5827","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-0.2.1.tgz","fileCount":27,"integrity":"sha512-GfRjV47W6R4sWLwb3lg80DMC3PYqHJo0tXAaw1DluSKLrK7LNl7hqNgBOLH01ehS9xtvweGbRQktjppr0JwM8g==","signatures":[{"sig":"MEUCIGvHLYmfpJzylZORE/xBSpWHhpKXs/zMPpQvQX0WwPMbAiEAxXw4LI61uOpXxoG/CYqOq7pk0Y42D1uphwehXpzVN3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53296},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"508ef3fac55c3fe14078023b365c51e596177cdd","scripts":{"test":"jest src/","build":"tsc --build","clean":"tsc --build --clean","prepack":"npm run build","clean:wipe":"rimraf ./dist"},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"repository":{"url":"git+https://github.com/32bitkid/4bitlabs.spatial.git","type":"git"},"_npmVersion":"lerna/8.1.6/node@v20.16.0+x64 (linux)","description":"A simple, TypedArray-backed resizable vector data-structure","directories":{},"_nodeVersion":"20.16.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vector_0.2.1_1722022002548_0.24141571279043172","host":"s3://npm-registry-packages"}},"0.2.2":{"name":"@4bitlabs/vector","version":"0.2.2","keywords":["data structures","typedarray","vector","bigint"],"author":"J. Holmes <32bitkid@gmail.com>","license":"ISC","_id":"@4bitlabs/vector@0.2.2","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"homepage":"https://32bitkid.github.io/4bitlabs.bits/modules/_4bitlabs_vector.html","bugs":"https://github.com/32bitkid/4bitlabs.bits/issues","dist":{"shasum":"48bcb88c7d58ae9506a6d18698cc9baf437d1cc4","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-0.2.2.tgz","fileCount":27,"integrity":"sha512-airhoM9Y/TJ4di9zDBmpVOdN9j+Fl4R2h2/RiTAmA5dKdUqZ4fu9k+F2Dw/9qOCUCtElwMnZOoZ+r0sTMOTSVQ==","signatures":[{"sig":"MEUCIQD34VrLZ/bHyYZzpyVwQBDm/9jgqdG7+D1THhTyuZmlYAIgJwqQy/+8IgKPOaU4PZlKw7tS2+RF/ZuiDdZSIYh+mUQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":53357},"main":"./dist/index.js","types":"./dist/index.d.ts","gitHead":"701af4acd63ec51c99a3080091694060e339d9d7","scripts":{"test":"jest src/","build":"tsc --build","clean":"tsc --build --clean","prepack":"npm run build","clean:wipe":"rimraf ./dist"},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"repository":{"url":"git+https://github.com/32bitkid/4bitlabs.bits.git","type":"git"},"_npmVersion":"lerna/8.1.7/node@v20.15.1+arm64 (darwin)","description":"A simple, TypedArray-backed resizable vector data-structure for ints, floats, and bigints","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vector_0.2.2_1722111856019_0.9916019145085493","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@4bitlabs/vector","version":"1.0.0","keywords":["data structures","typedarray","vector","bigint"],"author":{"name":"J. Holmes","email":"32bitkid@gmail.com"},"license":"ISC","_id":"@4bitlabs/vector@1.0.0","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"homepage":"https://32bitkid.github.io/4bitlabs.bits/modules/_4bitlabs_vector.html","bugs":{"url":"https://github.com/32bitkid/4bitlabs.bits/issues"},"dist":{"shasum":"e89a09c61b78e7b9d73a7cae4d39663e17643f1f","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-1.0.0.tgz","fileCount":23,"integrity":"sha512-yR0WK7fNlRpxi8eKxPf2ms90RNVVJaKw1cN2BuxDPEPZcCmw1YsKMhQuIGn1gI4uclBpdrMSzB3cArR63EHAQQ==","signatures":[{"sig":"MEUCIA7Gk+BXd/5weXaCiB1WktxCOYEKtS/CAyg5MPefsnqnAiEArlt2QrNfbCk+AuW4CVElMmPceN/P/9uR++PmO5cvn94=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56973},"type":"module","types":"./dist/index.d.ts","exports":"./dist/index.js","gitHead":"aeafbebac85dfbdc78525783292536cdbed45be6","scripts":{"test":"vitest run","build":"tsdown","prepack":"npm run build","clean:wipe":"rimraf ./dist"},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"repository":{"url":"git+https://github.com/32bitkid/4bitlabs.bits.git","type":"git"},"_npmVersion":"11.18.0","description":"A simple, TypedArray-backed resizable vector data-structure for ints, floats, and bigints","directories":{},"_nodeVersion":"22.18.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/vector_1.0.0_1784335818289_0.5416790056512804","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@4bitlabs/vector","version":"1.1.0","description":"A simple, TypedArray-backed resizable vector data-structure for ints, floats, and bigints","type":"module","exports":"./dist/index.js","types":"./dist/index.d.ts","homepage":"https://32bitkid.github.io/4bitlabs.bits/modules/_4bitlabs_vector.html","bugs":{"url":"https://github.com/32bitkid/4bitlabs.bits/issues"},"repository":{"type":"git","url":"git+https://github.com/32bitkid/4bitlabs.bits.git"},"scripts":{"clean:wipe":"rimraf ./dist","build":"tsdown","test":"vitest run","prepack":"npm run build"},"keywords":["data structures","typedarray","vector","bigint"],"author":{"name":"J. Holmes","email":"32bitkid@gmail.com"},"license":"ISC","gitHead":"e781617fab1192618c80f767341c2db6be7c00aa","_id":"@4bitlabs/vector@1.1.0","_nodeVersion":"22.23.1","_npmVersion":"lerna/9.0.7/node@v22.23.1+arm64 (darwin)","dist":{"integrity":"sha512-F2E4FUCMK+nKs5XlTl5dc4sMIjoAjPuuAy8HlEf6ejVQhL5tt0xqM6NWkTUtcNrL9MmBpXgDCrbyD3TbAIcipA==","shasum":"abb079a83807c205e83f4a415a93230b3b33b553","tarball":"https://registry.npmjs.org/@4bitlabs/vector/-/vector-1.1.0.tgz","fileCount":23,"unpackedSize":63194,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAVgvF6nHn/94uP15yMajuT8VXkTUXfZixBKTn+uSyavAiEAxrMDJ8QYNWiHRcYyDIfhcijcAuz7+EvGlYj1iuL7YQA="}]},"_npmUser":{"name":"32bitkid","email":"32bitkid@gmail.com"},"directories":{},"maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vector_1.1.0_1785386323398_0.13020350093852273"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-14T22:31:40.443Z","modified":"2026-07-30T04:38:43.697Z","0.1.0":"2024-07-14T22:31:40.732Z","0.1.1":"2024-07-15T01:47:49.334Z","0.1.2":"2024-07-15T13:42:21.079Z","0.2.0":"2024-07-24T03:09:46.223Z","0.2.1":"2024-07-26T19:26:42.765Z","0.2.2":"2024-07-27T20:24:16.277Z","1.0.0":"2026-07-18T00:50:18.424Z","1.1.0":"2026-07-30T04:38:43.532Z"},"bugs":{"url":"https://github.com/32bitkid/4bitlabs.bits/issues"},"author":{"name":"J. Holmes","email":"32bitkid@gmail.com"},"license":"ISC","homepage":"https://32bitkid.github.io/4bitlabs.bits/modules/_4bitlabs_vector.html","keywords":["data structures","typedarray","vector","bigint"],"repository":{"type":"git","url":"git+https://github.com/32bitkid/4bitlabs.bits.git"},"description":"A simple, TypedArray-backed resizable vector data-structure for ints, floats, and bigints","maintainers":[{"name":"32bitkid","email":"32bitkid@gmail.com"}],"readme":"# @4bitlabs/vector\n\n[![License][license]][npm]\n[![NPM Version][version]][npm]\n[![NPM Downloads][dl]][npm]\n[![Ko-fi][kofibadge]][kofi]\n\n[npm]: https://www.npmjs.com/package/@4bitlabs/vector\n[version]: https://img.shields.io/npm/v/%404bitlabs%2Fvector\n[license]: https://img.shields.io/npm/l/%404bitlabs%2Fvector\n[dl]: https://img.shields.io/npm/dy/%404bitlabs%2Fvector\n[kofibadge]: https://shields.io/badge/ko--fi-donate-ff5f5f?logo=ko-fi&style=for-the-badgeKo-fi\n[kofi]: https://ko-fi.com/32bitkid\n\nA simple, TypedArray-backed resizable vector data-structure.\n\n## Installing\n\nUsing npm:\n\n```shell\n$ npm install --save @4bitlabs/vector\n```\n\n## Documentation\n\nFull documentation for the library can be found [here](https://32bitkid.github.io/4bitlabs.bits/modules/_4bitlabs_vector.html)\n\n## Usage\n\n```ts\nimport { Vector } from '@4bitlabs/vector';\n\n/* Create a resizable vector of float64s */\nconst floats = new Vector(Float64Array, { initialCapacity: 10 });\nfloats.push(Math.random());\nconsole.log(floats.pop());\n\n/* Create a resizable vector of bytes */\nconst bytes = new Vector(Uint8ClampedArray, { initialCapacity: 255 });\nbytes.push(0x10);\nconsole.log(bytes.pop());\n```\n\nAlso included is `BigVector` for usage with `int64` and `uint64` sized integers:\n\n```ts\nimport { BigVector } from '@4bitlabs/vector';\n\nconst uint64s = new BigVector(BigUint64Array);\nuint64s.push(0xffff_ffff_ffff_ffffn);\n```\n\n## Resize in-place\n\nThe default implementations of `Vector` and `BigVector` reallocated and copied the underlying \n`ArrayBuffer` on `reallocate()` and `grow()`. In certain use-cases, this could cause undesirable\ngarbage-collection pressure. As of ES2024, support for \n[in-place, resizable `ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/resizable)\nis widely available in both Node and browsers. To use this, provide a `maximumCapacity` when creating a `Vector` or `BigVector`.\n\n```ts\nimport { Vector } from '@4bitlabs/vector';\n\nconst vec = new Vector(Uint8Array, { initialCapacity: 16, maximumCapcity: 1_024 });\nvec.reallocate(1_024); // growing in-place\nvec.reallocate(128); // shrinking in-place\n```\n\nAttempting to resize a `Vector` beyond its maximum capacity, either through\nadding values with `push()` and `pushN()` _or_ explicit resizing, will throw an exception.\n\n## License\n\n[ISC](https://github.com/32bitkid/4bitlabs.bits/blob/HEAD/libs/vector/LICENSE.txt)\n","readmeFilename":"README.md"}