{"_id":"@stricahq/cbors","_rev":"10-44846e01ee944613d67898e66a27165b","name":"@stricahq/cbors","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.0":{"name":"@stricahq/cbors","version":"1.0.0","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@1.0.0","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"f3942cf017227e8a86ea09ef1236f0db3923eba0","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-1.0.0.tgz","fileCount":24,"integrity":"sha512-Nt5puNsaVLmkE31yXYCJAmhgYn7ufs7gXRQcDS8ZnNmP9GuUfA9fCXbNUHT7K7UQgyi/dXolzr9R3q83+q250w==","signatures":[{"sig":"MEUCIQDVONDV8nJ5MXfG61iqFdHvLUrErbXqcU+NUPAU6vFT5wIgOR6KD/14bgMeZ6NEs5HFOveM94RDjWDKWlE9py0pudo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":148317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5SybCRA9TVsSAnZWagAAZoUQAIx9VuWuemTzXlbrvarI\nli4KCb7M3e9jOFTrjzUVpD7g2SZScegqD4O23w8kEgJjfiK0A1kxUAZCVU3A\nkeakE7Eq4F0UeAYzulDVDpq0tGzyxxKdW1ao1V9CqeN2NJytlWjAGvDo9VW1\nR5Lpnnajm0yfmalDb13eFIRQePY6iEWh+qQga8nT5a/+1YyU5Cth9en/irQX\nygurin6z9DIx6cre3sBJRw+POu9CYDHzkMpPm5DWa+9RG2QWDWTaTKX/N9mv\nocXy9jqi6A5N6KT5HmIGZ7CtslaSiTDsXHOFbYUYB7u/BeJ+JieNVEBF+kBX\nLX2YCgq6vFu6BZq1iNZBSEuivx6bwi+ZHyzDlHroJNXhW1N3+EQrXda4DvEn\n54RLzxmCbsYVjubIbMpv6sXg9cNn65KtRDZUmlrGA7vzYAX5IlpP5EtvVz0x\nseLz3bMr49HmLAFo2+n1T0yXKNOD/9YLdg4/R3+nU0kxUr9SlrHRyiE+J2GR\nx8lV5zY+HtjGktnKqQYCpRBt9/HzXkH4aLPmCb8LVxjzVIccl+LaGQxnQxTR\nAaI1NW1UzjHZSklzbHOU4G9WrRbtLV1uOrsl56liNRrHwc+SjHRPjORIFNfI\nne3/aa2Bt/pRGYeQ/lyl+WPnWzCKQlMocwUKEqS8+8e5zcWPsujeBR+ygXvJ\nf05q\r\n=mUjn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"ee6b8e809ef46deabfe15c3e349596c6941a9b32","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint src/**/*.ts","test":"ts-mocha tests/**/*.spec.ts","build":"rm -rf dist && tsc && webpack","lint:fix":"eslint --fix ."},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"7.5.0","description":"cbor encoder and decoder with annotation","directories":{},"_nodeVersion":"17.0.1","dependencies":{"buffer":"^6.0.3","bignumber.js":"^9.0.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.1.3","eslint":"^8.6.0","lodash":"^4.17.21","typedoc":"^0.22.10","webpack":"^5.66.0","prettier":"^2.5.1","ts-mocha":"^9.0.2","ts-loader":"^9.2.6","typescript":"^4.5.4","@types/chai":"^4.3.0","@types/node":"^17.0.8","webpack-cli":"^4.9.1","@types/mocha":"^9.0.0","stream-browserify":"^3.0.0","eslint-plugin-import":"^2.25.4","terser-webpack-plugin":"^5.3.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^5.9.1","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.9.1"},"_npmOperationalInternal":{"tmp":"tmp/cbors_1.0.0_1642409115669_0.14713935200414485","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@stricahq/cbors","version":"1.0.1","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@1.0.1","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"e28f7fc3cc62e7399a013c1f6e0e8d0ae24333aa","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-1.0.1.tgz","fileCount":24,"integrity":"sha512-vlQj7ygG0EQpQ7FsCTC9n7oAAvD6/Cqqsywk5vRPmdpFpCxRwB6ju+glkWwLKmshL8bJF953Oi0mLWdFEbjVcw==","signatures":[{"sig":"MEYCIQDNkbD7KCyACPuU1S1PqT/aY6eo+KPGHK2WwWhBlngLZAIhAPzzCNa9akeXKzktBI/Lnf1jkEYEf6JRjFOu0pgmNPfF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149242,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJijLT3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSJw//dDqsfJJwHynalaV5OXTnFtR8e6Wz3DMhQANYrR+wV9JxKVIP\r\nJYhs+RSWC1IhzkFxhrM7coPa59atzBVukAi0NOO0RkwRFHvmL7X/3E3Z05y8\r\nzIJ4HQ61NKaXqRwR7fR1NfTQOZShHvtnpCY1YWzjpY5PKSjUK3Gx41lX9UGr\r\ndtifcRNldQqjywdZhEqW9ncG/SNhSPQ+oJvvNQKYmgtpMFxQ0BlIVi0oozrh\r\nN+XCA4UQ99Onq2xvmX9fmQM6Z/cil4rfLFT1Q9mRxEGvjAg40ZYxNrIf+uqZ\r\nsJ9cdeE+/3f6HHtIstXSr+hnp43Zgi25y388b9W0mhc1LRkIxlilKh8kytlh\r\nnLZTLYXV7oDjWDjyOZksLUFtAfYOYTJFent2ij2mwSkpClmsM0mB0f7cquvK\r\n4u+PZ8/LMlW0digxBATwZM0tCEPztmF+aWCd+UXPmGobNAdBSijnmknO9UYn\r\no02vvEsCH+LALRryiM2db+v9TjnbicB66Lc8Ym3nuwoSxLT2dHXmZZzg7heo\r\nj4SLvjGRZrrehd0dLAxnCqmdZb36G2a2TqQQr881143Tb01fLj3TT+9KmqEu\r\nXYWKJ2BLYONp7tvX4P3qsfbAsy6WRGCRzrfdMkQEnx1RGX8/+AwqCZN6K6ag\r\nXyKGhYL2VSiyGVam6y5J2w3KLOcInUWtG2A=\r\n=3LPW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"dcc5051e821609dfe9c9f22b3022bac1ad6b4705","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint src/**/*.ts","test":"ts-mocha tests/**/*.spec.ts","build":"rm -rf dist && tsc && webpack","lint:fix":"eslint --fix ."},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"8.5.2","description":"cbor encoder and decoder with annotation","directories":{},"_nodeVersion":"17.7.1","dependencies":{"buffer":"^6.0.3","bignumber.js":"^9.0.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.1.3","eslint":"^8.6.0","lodash":"^4.17.21","typedoc":"^0.22.10","webpack":"^5.66.0","prettier":"^2.5.1","ts-mocha":"^9.0.2","ts-loader":"^9.2.6","typescript":"^4.5.4","@types/chai":"^4.3.0","@types/node":"^17.0.8","webpack-cli":"^4.9.1","@types/mocha":"^9.0.0","stream-browserify":"^3.0.0","eslint-plugin-import":"^2.25.4","terser-webpack-plugin":"^5.3.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^5.9.1","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.9.1"},"_npmOperationalInternal":{"tmp":"tmp/cbors_1.0.1_1653388534855_0.1692459019320507","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@stricahq/cbors","version":"1.0.2","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@1.0.2","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"e9085601b29bc04741e4e66c3f0fd207117e9f95","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-1.0.2.tgz","fileCount":24,"integrity":"sha512-6ePsEiq7EGHA5IiPn9poA7sF5iXPqt30kKw3pjR/BhP7S+XHZNu/OPumESWnVl4AM+IEYC2x9eL+4qRPsTPVww==","signatures":[{"sig":"MEYCIQCP+jXDd2GC1hOiIcuvmuERx9YncX4asCIOLB5XNbbn4QIhANQ9UrZxNn2lqlMzswZ+WJroz7zGhqFQj3ZrLkpW4Uk2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149273,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuV5jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqOUBAAm7PlEzi/wdv9G5ctyvMPoZdz9bCWzgxReMjmTw1j9PVaw63+\r\n++AQ/Q13blhk/QASGfYNvlHUwf9bBYDe1/jdfmJSz1xgr8mAyd0SAX9Yx2Ya\r\nzJJAWz8CX+CR9I8cwZeYOqBsi4U5XZW2TYTdxd7Z1CiWl4PGKAiBwDfX3lWM\r\niwLGQ/i7UpKOBMkwsVAGWvdMtB+SV/9glhYw/hEaE+E9nM8XaoaI0mg/8MU0\r\nMnlAxkcHUOEZell5I8T4tbPqXB7F/W4q/Mpe0iuCDqjYH6Vqzy2nsYChJhSP\r\nSc/Hn9szLE+dSKiWdrZQJh/7XTe4EHOQHsD711KeeiTzsJfGRhTBgLnvS5q7\r\n+bttSfHzt+rKn9AmxZECoN1UrgWX+mpsljvrH3e3umMH5Yi82nQr8degCL58\r\nO1adabsVIRyVIYQabMXZT2MibyoPoqfcpszgvcpoR2Wme1LVX3jcXbAwvX8X\r\n8dQoXM9zHkGSKIXbjUmLg5+UdeNARwUAucIXbRUhW+9sDykpl3UVpr/ZNFLH\r\n5dTZCLZ1FV1RDGqpd3ljfk05tE2WE75vS0XfmfbOFj62jHCvl0iSENbAlaB1\r\nP2l2Q+VIDC0jgV544OMqSsuF0JclvAabwLvol5kYVvLH8gkRuUVRgwO77zld\r\nEj5O4Rjz+VTsYyKO4l8V6Ev+WAJyWlzY4dY=\r\n=yLYa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"f8e3695f8b02533868f84df96d9800542caee1c9","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint 'src/**/*.ts'","test":"ts-mocha tests/**/*.spec.ts","build":"rm -rf dist && tsc && webpack","lint:fix":"eslint --fix 'src/**/*.ts'"},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"8.5.2","description":"cbor encoder and decoder with annotation","directories":{},"_nodeVersion":"17.7.1","dependencies":{"buffer":"^6.0.3","bignumber.js":"^9.0.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.1.3","eslint":"^8.6.0","lodash":"^4.17.21","typedoc":"^0.22.10","webpack":"^5.66.0","prettier":"^2.5.1","ts-mocha":"^9.0.2","ts-loader":"^9.2.6","typescript":"^4.5.4","@types/chai":"^4.3.0","@types/node":"^17.0.8","webpack-cli":"^4.9.1","@types/mocha":"^9.0.0","stream-browserify":"^3.0.0","eslint-plugin-import":"^2.25.4","terser-webpack-plugin":"^5.3.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^5.9.1","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.9.1"},"_npmOperationalInternal":{"tmp":"tmp/cbors_1.0.2_1656315491669_0.11081499337944889","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@stricahq/cbors","version":"1.0.3","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@1.0.3","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"ece966fef370919d5bf69a0ecabb4df23676ae34","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-1.0.3.tgz","fileCount":24,"integrity":"sha512-FlV5DaQtTeSSgkC9S4CiO167+x1t6uSNixQ32QMWIMG7+/LhOtzv4GPf4qJR6z7C31mzx+mRlf86dJt9lfBeVw==","signatures":[{"sig":"MEUCIEylNhVbao/M9tysRLV04tTkfWrxINeTkAUacyqp4LeeAiEA68OP+WI6AzObTNbDP4UcKrsL7Y6zhRITmlCVHae0n9c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":149208},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"2f72be5b6843c61ff90da5022191df3f78bc3404","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint 'src/**/*.ts'","test":"ts-mocha tests/**/*.spec.ts","build":"rm -rf dist && tsc && webpack","lint:fix":"eslint --fix 'src/**/*.ts'"},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"9.5.1","description":"cbor encoder and decoder with annotation","directories":{},"_nodeVersion":"19.8.1","dependencies":{"buffer":"^6.0.3","bignumber.js":"^9.0.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.1.3","eslint":"^8.6.0","lodash":"^4.17.21","typedoc":"^0.22.10","webpack":"^5.66.0","prettier":"^2.5.1","ts-mocha":"^9.0.2","ts-loader":"^9.2.6","typescript":"^4.5.4","@types/chai":"^4.3.0","@types/node":"^17.0.8","webpack-cli":"^4.9.1","@types/mocha":"^9.0.0","stream-browserify":"^3.0.0","eslint-plugin-import":"^2.25.4","terser-webpack-plugin":"^5.3.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^5.9.1","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.9.1"},"_npmOperationalInternal":{"tmp":"tmp/cbors_1.0.3_1714303979450_0.9012868263823457","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@stricahq/cbors","version":"1.0.4","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@1.0.4","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"c23c2244efe98fb79f9ff71e780025a703109739","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-1.0.4.tgz","fileCount":24,"integrity":"sha512-0VmdpoYIi3lxgF10gOYvY0+BxD+u7/M6H6afmPWuc8Klg6Zpj9mRQnsw5zv6nYeflfIDvD0NjSQDkANe3psBxg==","signatures":[{"sig":"MEUCIQDudrwTtdYH+nhVfBchKQe1lj9EkqrdlLonwIUh1Ky8YQIgR10ozn6lAcoeOP5hu0qR0crn3/D3AuZxlVhlNKs3hok=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":150854},"main":"dist/index.js","types":"./dist/index.d.ts","gitHead":"a361f8a9dea8e3a1dac72b663c5f2d8c24b6cd27","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint 'src/**/*.ts'","test":"ts-mocha tests/**/*.spec.ts","build":"rm -rf dist && tsc && webpack","lint:fix":"eslint --fix 'src/**/*.ts'"},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"10.8.3","description":"cbor encoder and decoder with annotation","directories":{},"_nodeVersion":"22.9.0","dependencies":{"buffer":"^6.0.3","bignumber.js":"^9.0.2"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.4","mocha":"^9.1.3","eslint":"^8.6.0","lodash":"^4.17.21","typedoc":"^0.22.10","webpack":"^5.66.0","prettier":"^2.5.1","ts-mocha":"^9.0.2","ts-loader":"^9.2.6","typescript":"^4.5.4","@types/chai":"^4.3.0","@types/node":"^17.0.8","webpack-cli":"^4.9.1","@types/mocha":"^9.0.0","stream-browserify":"^3.0.0","eslint-plugin-import":"^2.25.4","terser-webpack-plugin":"^5.3.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","@typescript-eslint/parser":"^5.9.1","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^5.9.1"},"_npmOperationalInternal":{"tmp":"tmp/cbors_1.0.4_1763376587003_0.3760234470877426","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@stricahq/cbors","version":"1.1.0","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@1.1.0","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"adac8675db56e898406a556244fb54e6ab5af638","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-1.1.0.tgz","fileCount":9,"integrity":"sha512-l5iw4UCZY5ewXpmKXV+t7cmWweSxyyVgUSRNcfIoyqybJGaTfKrggoQpKnqPKkfoQdwCLtv2s5PvNgZazCgVnQ==","signatures":[{"sig":"MEYCIQDnEoOCsTRnegYBqARD7x9Mazsf+57IML5LtukRzT+wUAIhAMXFTVPW0oZpmtUtImCZcyNfm80MtYGAykNcvXriE5sC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":473983},"main":"./dist/index.js","types":"./dist/index.d.ts","unpkg":"./dist/index.min.js","module":"./dist/index.mjs","browser":{"stream":"./dist/stream.js"},"engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"./package.json":"./package.json"},"gitHead":"b5ad1060175f31f959ef22fb788fa307f4f4027b","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint 'src/**/*.ts'","test":"vitest run","build":"rm -rf dist && tsup && cp shims/index.mjs shims/index.d.mts dist/","prepack":"yarn build","lint:fix":"eslint --fix 'src/**/*.ts'","typecheck":"tsc --noEmit","prepublishOnly":"yarn build && yarn test"},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"jsdelivr":"./dist/index.min.js","repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"11.6.2","description":"cbor encoder and decoder with annotation","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","dependencies":{"buffer":"^6.0.3","bignumber.js":"^9.3.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","eslint":"^8.57.1","lodash":"^4.17.21","vitest":"^4.1.0","typedoc":"^0.28.0","prettier":"^2.8.8","typescript":"^5.9.0","@types/node":"^24.0.0","@types/lodash":"^4.17.16","readable-stream":"^4.7.0","eslint-plugin-import":"^2.32.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^4.2.1","@typescript-eslint/parser":"^8.44.0","eslint-config-airbnb-base":"^15.0.0","@typescript-eslint/eslint-plugin":"^8.44.0"},"_npmOperationalInternal":{"tmp":"tmp/cbors_1.1.0_1783592635852_0.2985546673414463","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@stricahq/cbors","version":"2.0.0","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@2.0.0","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"39633f1b9093d8f729d1c7b837ee20b8a9d3399a","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-2.0.0.tgz","fileCount":6,"integrity":"sha512-IGet1HIu42pQkk8auUKuYZToLp3qCwrm1JxQ+AhY4Vu+dLlJStq4beG94YDTpgh6LTszux7cs9JNIlKcbMqvlg==","signatures":[{"sig":"MEUCIEnAoa5orqaSzsTnFW2PLOLgKuHDbNGGYRfTjNDx2RCEAiEAlpRb7N9Hh5UkNG0tq38OL1Cw889A6Xfldks42IA2iJg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":77743},"type":"module","types":"./dist/index.d.ts","unpkg":"./dist/index.min.js","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"c4e56423e25df0f29c9ac589fc60349a24195606","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint .","test":"vitest run","build":"rm -rf dist && tsup","prepack":"yarn build","lint:fix":"eslint --fix .","typecheck":"tsc --noEmit && tsc -p tsconfig.src.json --noEmit","prepublishOnly":"yarn build && yarn test"},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"jsdelivr":"./dist/index.min.js","repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"11.6.2","description":"cbor encoder and decoder with annotation","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","eslint":"^10.7.0","lodash":"^4.17.21","vitest":"^4.1.0","globals":"^17.7.0","typedoc":"^0.28.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^5.9.0","@types/node":"^24.0.0","@types/lodash":"^4.17.16","typescript-eslint":"^8.65.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.6"},"_npmOperationalInternal":{"tmp":"tmp/cbors_2.0.0_1784973384605_0.7069442427340202","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"@stricahq/cbors","version":"2.0.1","keywords":["cbor","strica","cardano"],"author":{"name":"Strica"},"license":"Apache-2.0","_id":"@stricahq/cbors@2.0.1","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"homepage":"https://github.com/StricaHQ/cbors#readme","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"84b68a5da5c0e857bf6f267f98eb529f403c8948","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-2.0.1.tgz","fileCount":6,"integrity":"sha512-MZt5YEt25Tbeql8YOEpIgpSZ6SauK0uZfYnUKcXmWjD5obzCy4l/2uLNRkqsN20JQ+D7k0+0mV6fW+Ow2pbRZg==","signatures":[{"sig":"MEYCIQDnMTe7MXLyONi6EiZRcTxc9ztKYHlKrECrZkPB0N2rVAIhAMjbSdgShPvzyyW3yd060LWvFhjc5SnDfX4zgxpxfHGr","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79017},"type":"module","types":"./dist/index.d.ts","unpkg":"./dist/index.min.js","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"98f5775c0c93399cd92148dd1da01c71cdaa4ac8","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint .","test":"vitest run","build":"rm -rf dist && tsup","prepack":"yarn build","lint:fix":"eslint --fix .","typecheck":"tsc --noEmit && tsc -p tsconfig.src.json --noEmit","prepublishOnly":"yarn build && yarn test"},"_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"jsdelivr":"./dist/index.min.js","repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"11.6.2","description":"cbor encoder and decoder with annotation","directories":{},"sideEffects":false,"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","eslint":"^10.7.0","lodash":"^4.17.21","vitest":"^4.1.0","globals":"^17.7.0","typedoc":"^0.28.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^5.9.0","@types/node":"^24.0.0","@types/lodash":"^4.17.16","typescript-eslint":"^8.65.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.6"},"_npmOperationalInternal":{"tmp":"tmp/cbors_2.0.1_1785041706765_0.9404434596264406","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"_id":"@stricahq/cbors@2.1.0","bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"dist":{"shasum":"09d7ad709ef900a74f336d6ef15e170d30e37674","tarball":"https://registry.npmjs.org/@stricahq/cbors/-/cbors-2.1.0.tgz","fileCount":6,"integrity":"sha512-zw+mdA1s73Gf2DDBVw155AyXIYAj5ao15Xe+vW5wdRxi3Ts4BjIGpA850O7j65h5iJK0Ru4STVhQHEvWbj7fIQ==","signatures":[{"sig":"MEUCIQDaZKcnk7SRusII08l5qgh3ykmJ04CIXI0prk0//Gyw5gIgOOb6+P+L4OHxL5Pdxup/wnPDkLncByxQLB0FSOk9Mq0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICM5GMGb3cbzxt+SXcH5GVK7YRpFc54RP8HgKBY19lOQAiEA80pt40ZQrCwQx9E1qpKJSbGd5kj2fbzMttbcAjjHffM="}],"unpackedSize":99413},"name":"@stricahq/cbors","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/index.min.js","author":{"name":"Strica"},"engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"0f060b9eb9f5d12177da6e75b8333ce5b61ac733","license":"Apache-2.0","scripts":{"docs":"rm -rf docs && typedoc","lint":"eslint .","test":"vitest run","build":"rm -rf dist && tsup","prepack":"yarn build","lint:fix":"eslint --fix .","typecheck":"tsc --noEmit && tsc -p tsconfig.src.json --noEmit","prepublishOnly":"yarn build && yarn test"},"version":"2.1.0","_npmUser":{"name":"ashisherc","email":"ashisherc@gmail.com"},"homepage":"https://github.com/StricaHQ/cbors#readme","jsdelivr":"./dist/index.min.js","keywords":["cbor","strica","cardano"],"repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"_npmVersion":"11.6.2","description":"cbor encoder and decoder with annotation","directories":{},"maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"sideEffects":false,"_nodeVersion":"24.13.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","eslint":"^10.7.0","lodash":"^4.17.21","vitest":"^4.1.0","globals":"^17.7.0","typedoc":"^0.28.0","prettier":"^3.9.6","@eslint/js":"^10.0.1","typescript":"^5.9.0","@types/node":"^24.0.0","@types/lodash":"^4.17.16","typescript-eslint":"^8.65.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.6"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cbors_2.1.0_1789720879876_0.5247795700234057"}}},"time":{"created":"2022-01-17T08:45:15.612Z","modified":"2026-09-18T08:41:20.195Z","1.0.0":"2022-01-17T08:45:15.865Z","1.0.1":"2022-05-24T10:35:35.107Z","1.0.2":"2022-06-27T07:38:11.830Z","1.0.3":"2024-04-28T11:32:59.591Z","1.0.4":"2025-11-17T10:49:47.210Z","1.1.0":"2026-07-09T10:23:56.008Z","2.0.0":"2026-07-25T09:56:24.743Z","2.0.1":"2026-07-26T04:55:06.898Z","2.1.0":"2026-09-18T08:41:19.977Z"},"bugs":{"url":"https://github.com/StricaHQ/cbors/issues"},"author":{"name":"Strica"},"license":"Apache-2.0","homepage":"https://github.com/StricaHQ/cbors#readme","keywords":["cbor","strica","cardano"],"repository":{"url":"git+https://github.com/StricaHQ/cbors.git","type":"git"},"description":"cbor encoder and decoder with annotation","maintainers":[{"name":"ashisherc","email":"ashisherc@gmail.com"}],"readme":"<p align=\"center\">\n  <a href=\"https://strica.io/\" target=\"_blank\">\n    <img src=\"https://docs.strica.io/images/logo.png\" width=\"200\">\n  </a>\n</p>\n\n# @stricahq/cbors\n\n[![npm](https://img.shields.io/npm/v/@stricahq/cbors.svg)](https://www.npmjs.com/package/@stricahq/cbors)\n[![downloads](https://img.shields.io/npm/dm/@stricahq/cbors.svg)](https://www.npmjs.com/package/@stricahq/cbors)\n[![node](https://img.shields.io/node/v/@stricahq/cbors.svg)](https://nodejs.org)\n[![dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](https://github.com/StricaHQ/cbors/blob/master/package.json)\n[![license](https://img.shields.io/npm/l/@stricahq/cbors.svg)](./LICENSE)\n\nCBOR ([RFC 8949](https://www.rfc-editor.org/rfc/rfc8949)) encoder and decoder for JavaScript, with no dependencies.\n\nThe thing that makes it different is what it remembers. Most decoders hand you a value and throw the encoding away. cbors can hand you an annotation tree instead: every item, primitives included, still knows which bytes it came from. That matters on Cardano, where a transaction is hashed and signed over its exact bytes and re-encoding a decoded value is not guaranteed to give you those bytes back.\n\n## v2 is a breaking change\n\nv2 is not a drop-in upgrade. It is ESM-only and needs Node >= 22.12, and the API, the number type, and the byte type all changed, so v1 code will not run unchanged against it. [Migrating from v1](#migrating-from-v1) lists every change and its replacement.\n\nMoving to v2 is the recommended path: it is faster than v1 (see [Benchmarks](#benchmarks)), carries no dependencies and no Node.js builtins, and it will get new features and fixes from here on.\n\n### Staying on v1\n\nv1 remains on npm and keeps working. Pin the major version to stay there:\n\n```sh\nyarn add @stricahq/cbors@1\n```\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@stricahq/cbors@1/dist/index.min.js\"></script>\n```\n\nv1 is a CJS + ESM dual package, runs on older Node, and uses `bignumber.js` and `Buffer`. Everything below documents v2.\n\n## Installation\n\n### yarn/npm\n\n```sh\nyarn add @stricahq/cbors\n```\n\n### Browser\n\n```html\n<script src=\"https://cdn.jsdelivr.net/npm/@stricahq/cbors/dist/index.min.js\"></script>\n\n// access the cbors global variable\n```\n\ncbors has no dependencies and uses no Node.js builtins, so bundlers need no polyfills or aliases for it.\n\n## Quick start\n\n```js\nimport { encode, decode } from \"@stricahq/cbors\";\n\nconst bytes = encode(new Map().set(0, [1, 2])); // Uint8Array a1 00 82 01 02\nconst value = decode(bytes);                    // Map(1) { 0 => [ 1, 2 ] }\n```\n\n`decode` returns the value directly, and throws if the input holds anything other than exactly one complete CBOR item.\n\nThat is the whole surface for simple work. Everything else the package exports:\n\n```js\nimport {\n  encode,             // value  -> Uint8Array\n  decode,             // bytes  -> value\n  decodeAnnotated,    // bytes  -> CborNode tree, keeps the original bytes of every item\n  IncrementalDecoder, // push chunks, get items as they complete\n  CborTag,            // a tagged value\n  SimpleValue,        // a simple value other than true/false/null/undefined\n  EncodedCbor,        // pre-encoded bytes to splice into the output as-is\n  IndefiniteArray,    // Array subclass that encodes in indefinite form\n  IndefiniteMap,      // Map subclass that encodes in indefinite form\n} from \"@stricahq/cbors\";\n```\n\nFor more examples, the [tests](https://github.com/StricaHQ/cbors/tree/master/tests) cover every supported data type.\n\n## What decodes to what\n\n```js\ndecode(bytes);\n```\n\n| CBOR | you get |\n|---|---|\n| integer within ±2^53 | `number` |\n| integer beyond ±2^53 | `bigint` |\n| bignum (tags 2 and 3) | `bigint` |\n| float16 / float32 / float64 | `number` |\n| byte string | `Uint8Array` |\n| text string | `string` |\n| array | `Array`, or `IndefiniteArray` if it was indefinite |\n| map | `Map`, or `IndefiniteMap` if it was indefinite |\n| any other tag | `CborTag { tag, value }` |\n| `true` / `false` / `null` / `undefined` | the same, unwrapped |\n| any other simple value | `SimpleValue { value }` |\n\nMaps always come back as a `Map`, never a plain object, because CBOR keys are not limited to strings. A decoded byte string is a zero-copy view into the buffer you passed in, so it stays valid as long as that buffer does.\n\n```js\nencode(value);\n```\n\n| you pass | you get |\n|---|---|\n| `number`, integral | integer, in the smallest head that fits |\n| `number`, fractional | float64 |\n| `NaN`, `±Infinity`, `-0` | the two-byte float16 forms |\n| `bigint` | integer if it fits in 64 bits, else a bignum tag |\n| `string` | text string |\n| `Uint8Array`, `Buffer`, `ArrayBuffer`, `Uint8ClampedArray` | byte string |\n| `Array` / `IndefiniteArray` | definite / indefinite array |\n| `Map` / `IndefiniteMap` | definite / indefinite map |\n| plain object | map with text keys |\n| `CborTag` | tagged item |\n| `SimpleValue` | simple value |\n| `EncodedCbor` | its bytes, spliced in untouched |\n| any other object (a class instance, `Date`, `Set`, `RegExp`, other typed arrays), functions, symbols | throws |\n\nAnything the encoder cannot represent faithfully throws rather than being silently mangled into a map of its fields. Note that an integral `number` always encodes as an integer, so `1.0` goes out as `01`, and floats are never shrunk to half or single precision. If you need a specific float encoding on the wire, splice it in with `EncodedCbor`.\n\nIndefinite-length arrays and maps survive a full round trip: they decode to `IndefiniteArray` / `IndefiniteMap`, which encode back to indefinite form.\n\n```js\nimport { IndefiniteArray } from \"@stricahq/cbors\";\n\nconst list = new IndefiniteArray();\nlist.push(1, 2);\nencode(list);                       // 9f 01 02 ff\nencode(decode(encode(list)));       // 9f 01 02 ff, still indefinite\n```\n\nIndefinite byte and text strings are the exception: they decode to a single joined `Uint8Array` / `string`, so a re-encode produces the definite form. If you need those bytes back exactly, use the annotation tree below.\n\n## Cardano\n\nEverything on Cardano is hashed and signed over exact CBOR bytes, and a value has more than one valid encoding. The integer 23 can be written as `17` or as `1817`. An array can be definite or indefinite. Both are legal, both decode to the same thing, and they hash to different values. So decoding a transaction and encoding it again is not a safe way to move it around: you may get different bytes, and different bytes mean a different transaction id or a broken signature.\n\ncbors handles both directions of this problem: `decodeAnnotated` on the way in, `EncodedCbor` on the way out.\n\n### The annotation tree\n\n`decodeAnnotated` returns a `CborNode` tree instead of a plain value. Every item carries its `kind`, its byte `span` in the source buffer, and the head-byte `encoding` info. `node.bytes` is a zero-copy slice of the original bytes of that item, header included.\n\nSo a transaction id is the hash of the body node's bytes:\n\n```js\nimport { decodeAnnotated } from \"@stricahq/cbors\";\n\n// tx = [body, witnessSet, isValid, auxiliaryData]\nconst tx = decodeAnnotated(txBytes);\nconst txId = blake2b256(tx.at(0).bytes); // any hash function\n```\n\n`tx.at(0).bytes` is the same stretch of memory as in `txBytes`, so the hash matches the on-chain id. The same trick covers datum hashes, script integrity hashes and anything else hashed over original bytes.\n\nWalking a node:\n\n- `node.at(k)` — array index, or the value of the first map entry whose key matches `k`. Keys can be a number/bigint (they cross-match), a string, a bool, or a `Uint8Array` matched by content. Returns a `CborNode` or `undefined`.\n- `node.bytes` — the exact source bytes for this item, header included.\n- `node.toJS()` — the plain `decode()` value for this subtree (joins indefinite chunks, collapses bignum tags, last-wins for duplicate keys).\n- `node.kind` — `uint`, `nint`, `bytes`, `text`, `array`, `map`, `tag`, `simple`, `float`, `bool`, `null` or `undefined`.\n- `node.value` — the payload of a leaf. For a byte string that is the bytes *without* the header, unlike `node.bytes`.\n- `node.items` — array children. `node.entries` — map entries, keeping order **and** duplicate keys. `node.chunks` — the pieces of an indefinite byte/text string. `node.child` — a tag's payload.\n- `node.span` — `[start, end)` offsets into the input. `node.encoding` — `{ ai, indefinite }`, the head byte's additional info and whether the item was indefinite.\n\nReading a couple of fields out of a transaction body:\n\n```js\nconst body = tx.at(0);\nconst fee = body.at(2).toJS();  // body key 2 is the fee\n\nconst inputs = body.at(0);      // body key 0 is the inputs\n// since Conway, sets arrive wrapped in tag 258\nconst inputItems = inputs.kind === \"tag\" ? inputs.child.items : inputs.items;\n```\n\n`decodeAnnotated` is one-shot: spans are offsets into a single contiguous buffer. For a stream, `IncrementalDecoder.annotated()` gives you the same tree per item as they complete.\n\n### Splicing pre-encoded bytes with EncodedCbor\n\n`EncodedCbor` wraps a buffer that already holds one encoded CBOR item, and the encoder writes those bytes into the output untouched instead of re-encoding them. Any bytes, from anywhere, at any position in the value you are encoding.\n\n```js\nimport { encode, EncodedCbor } from \"@stricahq/cbors\";\n\nconst raw = encode(new Map().set(1, 2).set(3, 4)); // a2 01 02 03 04, from wherever\n\nencode(new EncodedCbor(raw));      // a2 01 02 03 04, spliced in as-is\nencode(raw);                       // 45 a2 01 02 03 04, a Uint8Array is a byte string\nencode([1, new EncodedCbor(raw)]); // 82 01 a2 01 02 03 04, nests like any other value\n```\n\nPair it with `node.bytes` from the annotation tree and you can rebuild a transaction with one subtree replaced, while every untouched subtree keeps its original bytes. Attaching a witness set from a CIP-30 wallet is exactly that:\n\n```js\nimport { decodeAnnotated, encode, EncodedCbor } from \"@stricahq/cbors\";\n\nconst tx = decodeAnnotated(txBytes);\nconst witnessSet = await api.signTx(txHex, true); // CIP-30, hex string\n\nconst signedTx = encode([\n  new EncodedCbor(tx.at(0).bytes),      // body, spliced verbatim, its hash unchanged\n  new EncodedCbor(toBytes(witnessSet)), // fresh witness set from the wallet\n  true,                                 // isValid\n  null,                                 // auxiliaryData\n]);\n```\n\nThe buffer can come from anywhere: a wallet, a node, a cache, a slice of an annotation tree. It is spliced as given and never re-parsed or validated, so it has to be exactly one well-formed item.\n\ncbors ships no hex helper of its own. Anything that produces a `Uint8Array` works: `Buffer.from(hex, \"hex\")` on Node, `Uint8Array.fromHex(hex)` on runtimes that have it, or whichever hex utility your project already uses.\n\n## Tags\n\nTags are first class in both directions. Anything cbors does not fold into a native value decodes to a `CborTag`, and a `CborTag` encodes back to the same tag number and payload.\n\n```js\nimport { encode, decode, CborTag } from \"@stricahq/cbors\";\n\nconst bytes = encode(new CborTag([1, 2, 3], 258)); // d9 0102 83 01 02 03\n\nconst tagged = decode(bytes);\ntagged.tag;     // 258\ntagged.value;   // [1, 2, 3], the payload decoded normally\nencode(tagged); // the same bytes back\n```\n\nThere is no tag registry and no way to register a decoder for a tag: cbors gives you the number and the payload, and your code decides what it means. The one exception is bignums, tags 2 and 3, which decode straight to `bigint` because there is no lossless way to hand them back otherwise.\n\nTag numbers are supported over the full CBOR range, up to 2^64 - 1. Numbers beyond 2^53 come back as a `bigint` and can be passed back to `encode` the same way.\n\nTags you will meet on Cardano:\n\n| Tag | Used for | In cbors |\n|---|---|---|\n| 2, 3 | bignums | decode to `bigint`; `encode` emits them when a `bigint` exceeds 64 bits |\n| 24 | a byte string that holds another CBOR item | `new CborTag(bytes, 24)`; the payload stays a `Uint8Array`, run `decode` on it yourself if you want the value |\n| 30 | rational numbers, e.g. protocol parameters | `new CborTag([numerator, denominator], 30)` |\n| 258 | sets, since Conway | `new CborTag(items, 258)` |\n| 121-127, 1280-1400, 102 | Plutus data constructors | plain `CborTag`, the alternative is in the tag number |\n\nDecimal fractions (tag 4) work the same way, built explicitly:\n\n```js\nencode(new CborTag([-1, 15], 4)); // c4 82 20 0f, i.e. 15 * 10^-1\n```\n\n## Streaming\n\n`IncrementalDecoder` is a dependency-free push decoder for a stream of concatenated CBOR items, a chain-sync feed or a file of blocks. Feed it chunks as they arrive; each `push` returns the top-level items that completed in that chunk, as `{ value, bytes }`. Chunk boundaries can fall anywhere, including in the middle of an item. Call `end()` when the input is done, and it throws if the stream stopped mid-item.\n\n```js\nimport { IncrementalDecoder } from \"@stricahq/cbors\";\n\nconst decoder = new IncrementalDecoder();\nsocket.on(\"data\", (chunk) => {\n  for (const { value, bytes } of decoder.push(chunk)) {\n    // one entry per completed top-level item\n  }\n});\nsocket.on(\"end\", () => decoder.end());\n```\n\n`IncrementalDecoder.annotated()` decodes the same stream into [annotation trees](#the-annotation-tree): `value` is a `CborNode` instead of a plain value, so a streamed block or transaction still knows the bytes of every item inside it. Each item is framed into its own buffer, spans are offsets into that item, not into the stream.\n\n```js\nconst decoder = IncrementalDecoder.annotated();\nsocket.on(\"data\", (chunk) => {\n  for (const { value } of decoder.push(chunk)) {\n    const txId = blake2b256(value.at(0).bytes);\n  }\n});\n```\n\nTo `.pipe()` it into a Node.js stream, wrap it in a `Transform`: `push` each chunk on `transform`, and `end` on `flush`. The decoder stays dependency-free; you bring the stream glue.\n\n```js\nimport { createReadStream } from \"node:fs\";\nimport { Transform } from \"node:stream\";\nimport { IncrementalDecoder } from \"@stricahq/cbors\";\n\nconst decoder = new IncrementalDecoder();\nconst decodeStream = new Transform({\n  readableObjectMode: true,\n  transform(chunk, _enc, cb) {\n    try {\n      for (const item of decoder.push(chunk)) this.push(item);\n      cb();\n    } catch (err) {\n      cb(err);\n    }\n  },\n  flush(cb) {\n    try {\n      decoder.end();\n      cb();\n    } catch (err) {\n      cb(err);\n    }\n  },\n});\n\ncreateReadStream(\"stream.cbor\")\n  .pipe(decodeStream)\n  .on(\"data\", ({ value, bytes }) => {\n    // one entry per completed top-level item\n  });\n```\n\n## Options\n\nOptions are plain objects and always optional.\n\n`decode(bytes, options)`, `decodeAnnotated(bytes, options)`, `new IncrementalDecoder(options)` and `IncrementalDecoder.annotated(options)` take the same decoder options:\n\n| Option | Default | What it does |\n|---|---|---|\n| `maxDepth` | `1024` | Rejects items nested deeper than this. cbors itself handles any depth without running out of stack (`decode`, `toJS()` and `encode` alike), so the limit is there for code that walks decoded values recursively. |\n| `maxStringLength` | `4294967295` | Rejects a byte or text string, or an indefinite chunk, that declares a length above this. Stops a two-byte header from asking for a gigabyte allocation. This is also the ceiling: a larger value is clamped to it. |\n\n```js\ndecode(bytes, { maxDepth: 32, maxStringLength: 1 << 20 });\n```\n\nBoth limits take a non-negative integer. `Infinity` turns `maxDepth` off, and leaves `maxStringLength` at its ceiling.\n\n`encode(value, options)`:\n\n| Option | Default | What it does |\n|---|---|---|\n| `collapseBigInt` | `true` | Writes a `bigint` as a plain integer when it fits in 64 bits. Set it to `false` to always emit a bignum tag. |\n\n```js\nencode(10n);                             // 0a\nencode(10n, { collapseBigInt: false });  // c2 41 0a\n```\n\n### What the decoder rejects\n\nThe decoder is strict about well-formedness, and throws a plain `Error` rather than guessing:\n\n- trailing bytes after the item, or an item that ends early\n- reserved additional info 28-30\n- indefinite length on a major type that has no indefinite form\n- indefinite string chunks of the wrong major type, or themselves indefinite\n- text strings that are not valid UTF-8\n- two-byte simple values below 32, which RFC 8949 forbids\n- anything past `maxDepth` or `maxStringLength`\n\n## Benchmarks\n\nReal Cardano CBOR data, single threaded.\n\n| Workload | Size | `decode` | `decodeAnnotated` | `encode` | `IncrementalDecoder` |\n|---|---|---|---|---|---|\n| Smallest tx | 193 B | 351 MB/s | 274 MB/s | 246 MB/s | 159 MB/s |\n| Median tx | 576 B | 558 MB/s | 439 MB/s | 314 MB/s | 312 MB/s |\n| Largest tx | 16.0 kB | 452 MB/s | 867 MB/s | 696 MB/s | 433 MB/s |\n| Full block (1 item, 15 txs) | 86.9 kB | 419 MB/s | 699 MB/s | 679 MB/s | 334 MB/s |\n\nA median 576 B transaction decodes in about 1.0 µs, a full 87 kB block in about 0.20 ms. `decodeAnnotated` tracks plain `decode` closely, and runs ahead of it on large map-heavy items.\n\nMeasured on an Apple M1 Pro, Node 24.13.0.\n\n## Migrating from v1\n\n| v1 | v2 |\n|---|---|\n| `Encoder.encode(x)` | `encode(x)` |\n| `Decoder.decode(x).value` | `decode(x)` (returns the value directly) |\n| `getCborBytes(buf, item)` / byte spans | `decodeAnnotated(buf)` → `node.at(...).bytes` |\n| `hasByteSpan` / `Spanned` guards | annotation tree carries spans for every item |\n| `new Decoder()` Transform stream | `new IncrementalDecoder()` (`push` / `end`) |\n| BigNumber (via `bignumber.js`) | native `bigint` (BigNumber inputs now throw) |\n| `collapseBigNumber` encode option | `collapseBigInt` |\n| decimal fractions via BigNumber | `new CborTag([exponent, mantissa], 4)` |\n| `Buffer` in and out | `Uint8Array` out; `Buffer` still accepted as input |\n| `buffer` polyfill for browsers | no dependencies, no Node.js builtins |\n| CJS + ESM dual package | ESM only, `require(esm)` on Node >= 22.12 |\n\n## API Doc\n\nFind the API documentation [here](https://docs.strica.io/lib/cbors).\n\n# License\nCopyright 2022 Strica\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","readmeFilename":"README.md"}