{"versions":{"0.1.0":{"name":"bun-ffi-structs","version":"0.1.0","module":"index.js","main":"index.js","types":"index.d.ts","license":"MIT","type":"module","repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"^5.0.1"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.1.0","_integrity":"sha512-NoRfJ81pgLIHCzw624/2GS2FuxcU0G4SRJww/4PXvheNVUPSIUjkOC6v1/8rk66tJVCb9oR0D6rDNKK0qT5O2Q==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"1a9c61d58cce60669ea84ccbee5032c0cab6b12d","dist":{"integrity":"sha512-NoRfJ81pgLIHCzw624/2GS2FuxcU0G4SRJww/4PXvheNVUPSIUjkOC6v1/8rk66tJVCb9oR0D6rDNKK0qT5O2Q==","shasum":"1a9c61d58cce60669ea84ccbee5032c0cab6b12d","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.1.0.tgz","fileCount":8,"unpackedSize":34032,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHGTo/EJTdqfHHjgMCMw1QQgHoxeANEG66Fex8YhK0d1AiEArXCEQirMZysbEBYprksencdoV50nxjXNr2JIWb/TNY0="}],"size":8017},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.1.0_1761073072981_0.6959228776489845"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-21T18:57:53.160Z","publish_time":1761073073160,"_source_registry_name":"default","contributors":[]},"0.1.1":{"name":"bun-ffi-structs","version":"0.1.1","module":"index.js","main":"index.js","types":"index.d.ts","license":"MIT","type":"module","repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"^5.0.1"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.1.1","_integrity":"sha512-Um8Kc4RCjxDQ9nFMrit4VaPHfbBW8xbeXH2csLXIEP/45CaeVoUec9X6i19khBxODsDNNZ1VC9EGYhjYa4Ptag==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"4f888640f59439e43e5feb3400b502a083e87802","dist":{"integrity":"sha512-Um8Kc4RCjxDQ9nFMrit4VaPHfbBW8xbeXH2csLXIEP/45CaeVoUec9X6i19khBxODsDNNZ1VC9EGYhjYa4Ptag==","shasum":"4f888640f59439e43e5feb3400b502a083e87802","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.1.1.tgz","fileCount":8,"unpackedSize":34700,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFilMNtKLN7XPGZecVQ4TUswjxR6ecmvZ/FYXXFwwChzAiEA3Gts71/9+TJBBNXP0aiUQZl94q4zf44/+FNioB/PA10="}],"size":8113},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.1.1_1762864870460_0.26324757803313337"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-11T12:41:10.698Z","publish_time":1762864870698,"_source_registry_name":"default","contributors":[]},"0.1.2":{"name":"bun-ffi-structs","version":"0.1.2","module":"index.js","main":"index.js","types":"index.d.ts","license":"MIT","type":"module","repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"^5.0.1"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.1.2","_integrity":"sha512-Lh1oQAYHDcnesJauieA4UNkWGXY9hYck7OA5IaRwE3Bp6K2F2pJSNYqq+hIy7P3uOvo3km3oxS8304g5gDMl/w==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"afedf28e9df08eab628032896511d4987eb269ec","dist":{"integrity":"sha512-Lh1oQAYHDcnesJauieA4UNkWGXY9hYck7OA5IaRwE3Bp6K2F2pJSNYqq+hIy7P3uOvo3km3oxS8304g5gDMl/w==","shasum":"afedf28e9df08eab628032896511d4987eb269ec","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.1.2.tgz","fileCount":8,"unpackedSize":35221,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC2d6GLOh+Y4XUpnDVClz9lX/cKZ8/54cUHnyDkgfo0wwIgSFdvqTbFhcUy1AfZe/0dS0sNu3LS6TI/DAxAoMKCLQU="}],"size":8237},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.1.2_1762871118423_0.43826058826350267"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-11-11T14:25:18.612Z","publish_time":1762871118612,"_source_registry_name":"default","contributors":[]},"0.2.1":{"name":"bun-ffi-structs","version":"0.2.1","module":"./dist/index.js","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"^5.0.1"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.2.1","_integrity":"sha512-O+EpRGOPHZ1GxFEv92mjVa8qitK7x9PnoG6cowNWMHLPCA6TjIye+jaQJd5dcdj4sSyIdght6axxOgwQ5zIoNw==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"235319b32f1553f6ea202210ae267c2a63695832","dist":{"integrity":"sha512-O+EpRGOPHZ1GxFEv92mjVa8qitK7x9PnoG6cowNWMHLPCA6TjIye+jaQJd5dcdj4sSyIdght6axxOgwQ5zIoNw==","shasum":"235319b32f1553f6ea202210ae267c2a63695832","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.2.1.tgz","fileCount":9,"unpackedSize":39138,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHVRCmfdGQTDw+w1lKsFVbfyQklBz9R92W9BwTcNEhv4AiEA+MqMHHEu8mbQ8kdlr4PysvbplbQ6VMciliAnN8FERWM="}],"size":9130},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.2.1_1777406122650_0.887643554879139"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-04-28T19:55:22.812Z","publish_time":1777406122812,"_source_registry_name":"default","contributors":[]},"0.2.2":{"name":"bun-ffi-structs","version":"0.2.2","module":"./dist/index.js","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"^5.0.1"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.2.2","_integrity":"sha512-N/ZWtyN0piZlrXQT7TO0V+q952orYqkfhXRXM1Hcbb+R3QSiBH4vLnib187Mrs1H7pWIYECAmPeapGYDOMCl+w==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"a9e735133d0227f0b61a484fc1f833091a618c2c","dist":{"integrity":"sha512-N/ZWtyN0piZlrXQT7TO0V+q952orYqkfhXRXM1Hcbb+R3QSiBH4vLnib187Mrs1H7pWIYECAmPeapGYDOMCl+w==","shasum":"a9e735133d0227f0b61a484fc1f833091a618c2c","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.2.2.tgz","fileCount":9,"unpackedSize":39389,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD+yvWwYC+cBtMiRKbCb5x/P+O5gxTbOD2W0+Bs29ZB6gIhAOA7QPb2f7txWfCBUWeMDZt6pVTCyZPElmygQI30J7oE"}],"size":9158},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.2.2_1777537515576_0.7951545126055173"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-04-30T08:25:15.722Z","publish_time":1777537515722,"_source_registry_name":"default","contributors":[]},"0.2.3":{"name":"bun-ffi-structs","version":"0.2.3","module":"./dist/index.js","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"^5.0.1"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.2.3","_integrity":"sha512-pgJiXP+hEgFo9qG51J6ItfY4ocs3vniwNzJ9WhoakB3QB2GdzQxX2EXssentPYlB2hOfJrTjO6iIQkWYzUodpg==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"f5cbf0f0d03f0e77dd6e8beb9137a581a6a6bdca","dist":{"integrity":"sha512-pgJiXP+hEgFo9qG51J6ItfY4ocs3vniwNzJ9WhoakB3QB2GdzQxX2EXssentPYlB2hOfJrTjO6iIQkWYzUodpg==","shasum":"f5cbf0f0d03f0e77dd6e8beb9137a581a6a6bdca","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.2.3.tgz","fileCount":9,"unpackedSize":39633,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDUgGuSRJ6pztK4yY9M83UWnv3UjJ17qNtgONFAZcoEnwIgfVyYYbNGFapaC1Lasxir94st3/lEEVF/vBnK/B8xSos="}],"size":9203},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.2.3_1778534918869_0.6655894131072089"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-05-11T21:28:39.005Z","publish_time":1778534919005,"_source_registry_name":"default","contributors":[]},"0.2.4":{"name":"bun-ffi-structs","version":"0.2.4","module":"./dist/index.js","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"^5.0.1"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.2.4","_integrity":"sha512-AJzsqoVFs1KBbJbWHIYrVZLDC3NhTqqh25awRXqzoLzmBAKr5oqk6+CwuYHAekKx+VBCYVohBoKuRq40dV+TYg==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"e23e4120d9ebe47efb70b8ce459c834e7c7d7cb0","dist":{"integrity":"sha512-AJzsqoVFs1KBbJbWHIYrVZLDC3NhTqqh25awRXqzoLzmBAKr5oqk6+CwuYHAekKx+VBCYVohBoKuRq40dV+TYg==","shasum":"e23e4120d9ebe47efb70b8ce459c834e7c7d7cb0","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.2.4.tgz","fileCount":9,"unpackedSize":40164,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDXwhT76iO3YlIQO9+Gcg5V8tbGOYDFwew1GQPxEulflQIhAPgrr5i0Y9bogtwTCySxHBuZPqYgmsPLPjntAKuf7N5M"}],"size":9293},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.2.4_1782982887635_0.747497890543553"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-07-02T09:01:27.796Z","publish_time":1782982887796,"_source_registry_name":"default","contributors":[]},"0.3.0":{"name":"bun-ffi-structs","version":"0.3.0","module":"./dist/index.js","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"repository":{"type":"git","url":"https://github.com/sst/bun-ffi-structs.git"},"scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","bench:quick":"bun run bench/structs.bench.ts --profile quick","bench:full":"bun run bench/structs.bench.ts --profile full","bench:strict":"bun run bench/structs.bench.ts --profile full --strict-rme","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"6.0.2"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.3.0","_integrity":"sha512-wyUMPvIXCEkymeRApw42wu/nHJxv8p3eaFy96MBWfF7wSpGTKeKFAQ9f58y8WnLGQ7eZYR3fLu71/H5qBC3+FQ==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"85f050ffb4b11b1410ec578c7f9123f4960fb151","dist":{"integrity":"sha512-wyUMPvIXCEkymeRApw42wu/nHJxv8p3eaFy96MBWfF7wSpGTKeKFAQ9f58y8WnLGQ7eZYR3fLu71/H5qBC3+FQ==","shasum":"85f050ffb4b11b1410ec578c7f9123f4960fb151","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.3.0.tgz","fileCount":9,"unpackedSize":56075,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFndVe/GTvtZIb70p+6gH8/+6R8LjdKnSa59aoWHnIkoAiEA3eXvKWh8GIUJvjjw8TzKbmW7i66T2S2SsGjuISO/dVw="}],"size":11948},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.3.0_1784668150866_0.7071800488243074"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-07-21T21:09:11.014Z","publish_time":1784668151014,"_source_registry_name":"default","contributors":[]},"0.3.1":{"name":"bun-ffi-structs","description":"Type-safe C-style struct packing and unpacking for Bun and Node.js FFI","version":"0.3.1","module":"./dist/index.js","main":"./dist/index.js","types":"./dist/index.d.ts","license":"MIT","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"repository":{"type":"git","url":"https://github.com/anomalyco/bun-ffi-structs.git"},"homepage":"https://github.com/anomalyco/bun-ffi-structs#readme","bugs":"https://github.com/anomalyco/bun-ffi-structs/issues","scripts":{"test":"bun test","bench":"bun run bench/structs.bench.ts","bench:quick":"bun run bench/structs.bench.ts --profile quick","bench:full":"bun run bench/structs.bench.ts --profile full","bench:strict":"bun run bench/structs.bench.ts --profile full --strict-rme","prettier:check":"bun prettier --check .","prettier:write":"bun prettier --write .","build":"./scripts/build.sh"},"devDependencies":{"@types/bun":"latest","prettier":"3.6.2","tinybench":"6.0.2"},"peerDependencies":{"typescript":"^5"},"prettier":{"semi":false,"printWidth":120},"_id":"bun-ffi-structs@0.3.1","_integrity":"sha512-3gM7PpVWLyrwxWjcilSiGuhWanhZivvo6l0u573NziPH6f/gwk6McbaYgn7oJWov6pKGRTDbrg94W5DcJsKTtQ==","_nodeVersion":"24.3.0","_npmVersion":"10.8.3","shasum":"8af2f351a51310a8673dbe60c30dbad11d78a6ec","dist":{"integrity":"sha512-3gM7PpVWLyrwxWjcilSiGuhWanhZivvo6l0u573NziPH6f/gwk6McbaYgn7oJWov6pKGRTDbrg94W5DcJsKTtQ==","shasum":"8af2f351a51310a8673dbe60c30dbad11d78a6ec","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/bun-ffi-structs/-/bun-ffi-structs-0.3.1.tgz","fileCount":9,"unpackedSize":66791,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC0aU7ictteQOSiB5BKv2knjSgFWz1A9WgO3CnFhlO1UQIgX3hcVAP0IW9MiLFhD18WwBUmYiYrnumAnKRk0kjV76M="}],"size":13842},"_npmUser":{"name":"anonymous","email":"rootkid815@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"rootkid815@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bun-ffi-structs_0.3.1_1784733966458_0.0349287329094532"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-07-22T15:26:06.626Z","publish_time":1784733966626,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.3.1"},"name":"bun-ffi-structs","time":{"created":"2025-10-21T18:58:06.666Z","modified":"2026-07-22T15:26:27.776Z","0.1.0":"2025-10-21T18:57:53.160Z","0.1.1":"2025-11-11T12:41:10.698Z","0.1.2":"2025-11-11T14:25:18.612Z","0.2.1":"2026-04-28T19:55:22.812Z","0.2.2":"2026-04-30T08:25:15.722Z","0.2.3":"2026-05-11T21:28:39.005Z","0.2.4":"2026-07-02T09:01:27.796Z","0.3.0":"2026-07-21T21:09:11.014Z","0.3.1":"2026-07-22T15:26:06.626Z"},"readme":"# bun-ffi-structs\n\nTypeScript struct-packing library for Bun and Node.js `node:ffi` workflows. Define and pack/unpack C-style structs with memory layout control for FFI calls.\n\n## Features\n\n- **Type-safe struct definitions** with primitives (u8, u16, u32, u64, i16, i32, i64, f32, f64, bool_u8, bool_u32, pointer)\n- **Enums** with custom base types and bidirectional mapping\n- **Nested structs** (inline or as pointers)\n- **Arrays** of primitives, enums, structs, and object pointers\n- **Fixed little-endian layout** with size-based alignment tested on x64 and arm64\n- **Field options**: optional, defaults, validation, transforms (packTransform, unpackTransform)\n- **Conditional fields** for platform-specific layouts\n- **mapValue/reduceValue** transformations for input/output type conversions\n- **Object pointers** for referencing external objects with `.ptr` property\n- **Allocation utilities** with pre-allocated sub-buffers for arrays\n- **C strings** (null-terminated) and raw string pointers\n- **Reusable decoding** into caller-owned objects and `DataView` storage\n- **Reusable primitive lists** with `packListInto`\n\n## Installation\n\n```bash\nbun install bun-ffi-structs\n```\n\nPure primitive layouts work on Node.js without FFI flags. Pointer-backed operations require Node.js 26.1 or newer with\n`--experimental-ffi`; when using Node's Permission Model, also pass `--permission --allow-ffi`.\n\nFor local development, run `bun run build`, then use `scripts/link-dev.sh <target-project-root>` to symlink this package into\nanother project's `node_modules`.\n\n## Usage\n\nSee [examples/README.md](examples/README.md) for runnable examples demonstrating various features.\n\n```typescript\nimport { defineStruct, defineEnum, allocStruct, objectPtr } from \"bun-ffi-structs\"\n\nconst ColorEnum = defineEnum({ RED: 0, GREEN: 1, BLUE: 2 })\n\nconst PositionStruct = defineStruct([\n  [\"x\", \"f32\"],\n  [\"y\", \"f32\"],\n  [\"z\", \"f32\"],\n])\n\nconst ObjectStruct = defineStruct([\n  [\"id\", \"u32\"],\n  [\"position\", PositionStruct],\n  [\"color\", ColorEnum],\n  [\"count\", \"u32\", { lengthOf: \"items\" }],\n  [\"items\", [\"u32\"]],\n])\n\nconst buffer: ArrayBuffer = ObjectStruct.pack({\n  id: 42,\n  position: { x: 1.0, y: 2.0, z: 3.0 },\n  color: \"BLUE\",\n  items: [10, 20, 30],\n})\n\nconst unpacked = ObjectStruct.unpack(buffer)\n// -> resolves to type {\n//   id: number\n//   position: { x: number, y: number, z: number }\n//   color: \"RED\" | \"GREEN\" | \"BLUE\"\n//   items: Iterable<number>\n//   count?: number | null | undefined\n// }\n```\n\n### Reusable Storage\n\nDefinitions without a top-level `reduceValue` expose\n`unpackInto(view, target, offset = 0)`. The offset is relative to the supplied `DataView`, the complete struct must fit before any\ntarget mutation occurs, and the same target is returned. Struct defaults are reapplied before decoding, `mapValue` is not called,\nand unrelated target properties remain unless overwritten by a struct default. Nested values, strings, and arrays can still allocate.\n\n```typescript\nconst CursorStruct = defineStruct([\n  [\"row\", \"u32\"],\n  [\"col\", \"u32\"],\n])\n\nconst packed = CursorStruct.pack({ row: 4, col: 8 })\nconst cursor = {}\nCursorStruct.unpackInto(new DataView(packed), cursor)\n```\n\nOption-free definitions containing only required, non-pointer primitive fields expose\n`packListInto(objects, view, offset, options?)`:\n\n```typescript\nconst buffer = new ArrayBuffer(CursorStruct.size * 2)\nCursorStruct.packListInto(\n  [\n    { row: 1, col: 2 },\n    { row: 3, col: 4 },\n  ],\n  new DataView(buffer),\n  0,\n)\n```\n\n`packListInto` deliberately excludes enums, pointers, strings, arrays, defaults, transforms, validation, mapping, reducers, and\nnested structs. Those definitions require stronger dirty-buffer or pointer-owner semantics than reusable primitive storage.\n\nHot required-primitive `pack`, `packInto`, `packList`, `packListInto`, `unpack`, and `unpackInto` paths are generated after a measured\nwarmup threshold. Primitive `unpackList` definitions with `reduceValue` receive equivalent specialization while preserving the reducer\ncallback. Environments that disable string code generation automatically continue on the generic implementations.","users":{}}