{"_id":"bncode","_rev":"29-7f1596e0b42b8827430e01702df3051d","name":"bncode","dist-tags":{"latest":"0.6.0"},"versions":{"0.1.3":{"name":"bncode","version":"0.1.3","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.1.3","dist":{"shasum":"88cad47ea593e8310288d5998d52b0c480de7cc7","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.1.3.tgz","integrity":"sha512-sF+YRRd/UZ8a4IeLpSSsx6+x/2SGmYd6guH+nty+VUK5UtBfsHPkjbe8lIffhL58dUuUojX8MzQVsYrqZylx1A==","signatures":[{"sig":"MEYCIQCOW5cY8me6uY/Csq9ArrMdRJeeN4Pi5E9t17h3mCW2eAIhANjODXBmr4gNTX9lu+cx/hbZPRZw0nBM23U9XvPCn0tD","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","files":[""],"engines":{"node":"*"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"0.3.9","description":"bittorrent bencoding and decoding.","directories":{},"_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"_engineSupported":true},"0.1.4":{"name":"bncode","version":"0.1.4","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.1.4","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"dist":{"shasum":"60e27699f3af26940d6d546f16d1a4284e164b7a","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.1.4.tgz","integrity":"sha512-2BVtKvlGZPfHqVUPdiB5QJ3uYlvDULsQbylVAvo9qIKC+cWyq6VlPYGYV/SbyazC6B54QdX8fDpGJMHvLc7AFQ==","signatures":[{"sig":"MEYCIQDLih3VaIBSEQCUOiEcdy1eCxOs3KbblZTj+svrJ9ID6wIhAMbA8y3BcU4CzjxVRCdGe+tQq4ScWsnP+AJDjlJKCJ9f","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","files":[""],"engines":{"node":"*"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"0.3.18","description":"bittorrent bencoding and decoding.","directories":{},"_nodeVersion":"v0.4.7","_defaultsLoaded":true,"_engineSupported":true},"0.1.5":{"name":"bncode","version":"0.1.5","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.1.5","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"dist":{"shasum":"22fbf35b9a505ebc4d5876dda7c5625f10a8f3ff","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.1.5.tgz","integrity":"sha512-xYLC8FzzfXn4AeWSIFlnH9TylxQMr82OeBlD7BzyDlw6X3efdq63adkUqfB/HVHeqdE/um/BUNIi8uEFmAIxAA==","signatures":[{"sig":"MEYCIQD6AUXTPA6/+miMaN5Fd0SRw3Xoc4ynHUvDYfZNcqgoMAIhANcdlh229rFw6kqHSQW5xCwLovHvuFVuWJdkYHlioyU6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","files":[""],"engines":{"node":"*"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"0.3.18","description":"bittorrent bencoding and decoding.","directories":{},"_nodeVersion":"v0.4.7","_defaultsLoaded":true,"_engineSupported":true},"0.2.0":{"name":"bncode","version":"0.2.0","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.2.0","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"dist":{"shasum":"6fe267e884495e3bf4770adfa91f1a874ae9af1e","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.2.0.tgz","integrity":"sha512-tbPrFYUDgQgDat1/hPQSRwG4fgdDCFm2QJjOJ6TQHXZZoWt4ckHuoCGZTZ59FcnQUgjTIbLB0T9m3ksQgJmtyA==","signatures":[{"sig":"MEUCIDduq6mahGiBkXd2p0OBu+u0D5agnrN8rXO8DHAMdRdWAiEArY+rsZqDee4zsQiE5+xRLZCRgfQKoBHTVS9BQvAO8Is=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","engines":{"node":"*"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"1.0.99","description":"bittorrent bencoding and decoding.","directories":{},"_nodeVersion":"v0.5.9-pre","dependencies":{},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.2.1":{"name":"bncode","version":"0.2.1","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.2.1","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"dist":{"shasum":"e99b5e5e4f2088459815d71527f2429574f21e4e","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.2.1.tgz","integrity":"sha512-jh4Mym1tpWhbihjUA8l3TFrskiWBIaeYAP7vAPndibyTy9NBS0Tk4uMFLt+Lz1jCrY1soiz1EGZ4xMzxV46QBw==","signatures":[{"sig":"MEUCIGcVl5mjVgZi6AwVXYrCBBNUGDx/6pnMuaKXMutm2U4yAiEAw/UR7/XuF2J1QKIitdbVom7d7QASdd7UNBjQjBYaFxE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","engines":{"node":"*"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"1.1.0-beta-4","description":"bittorrent bencoding and decoding.","directories":{},"_nodeVersion":"v0.6.6","dependencies":{},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.2.2":{"name":"bncode","version":"0.2.2","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.2.2","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"dist":{"shasum":"e6a60f35e4fa5b79eeffcaf56d4cd5b59c766f26","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.2.2.tgz","integrity":"sha512-lP8XIK/JUOU/c+5r9RHkZjT9ndVQHcpsZRhok/R2fr545jZ1mOOay5WRleC43VAFMziWgii2d2j5GI8qnWIAjA==","signatures":[{"sig":"MEYCIQCrGU/RJBsUX7NcamkRo5ilIdVn/MASbvORFUcth0XZwwIhAMxXguFwbU3dH3aqWne8F/eOfTn/wyiOd164TaZ73Q/+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","engines":{"node":"*"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"1.1.0-beta-4","description":"bittorrent bencoding and decoding.","directories":{},"_nodeVersion":"v0.6.6","dependencies":{},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true},"0.2.3":{"name":"bncode","version":"0.2.3","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.2.3","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"dist":{"shasum":"37f851dc8e47188a83fbc0f6fa4775cacc9a3296","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.2.3.tgz","integrity":"sha512-IXGfySD68R/J2X/it8GZqAM+Vb3ByZvAlUi0Gysq4ZACq6hXGQ3YshKo0QS/f3S9wOWKjJnEjP6x3ELxqBnAOA==","signatures":[{"sig":"MEYCIQDbFFQcVcZFqBvRgohxNFGzCpufjYnVtIkR3uGplwZvlQIhALwO/rCc7mBSD+XopldnFNFLxeSE42axtx8YSWUuNgnT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"1.1.49","description":"bittorrent bencoding and decoding.","directories":{}},"0.3.0":{"name":"bncode","version":"0.3.0","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.3.0","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"bugs":{"url":"https://github.com/a2800276/bencode.js/issues"},"dist":{"shasum":"48247b02facf3c9961b4896403889c036b6fb6b9","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.3.0.tgz","integrity":"sha512-SWhtG+mCf0q91Ja9s3dEEkzSbyTTN+VwtxJkOj3opJ6EuqHJXWLZh0yJQlRkc7R1Myq6k9ZdZK04WjyQcQ26KQ==","signatures":[{"sig":"MEYCIQC+mQfquDyufuXF9Kfld6wNYpzLnDbUL+0j/lxyNYdADgIhANv4mBm1TDbIjol/OaIkHX84G/44FdERnCxbUBOAIBDi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","_from":".","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"1.2.23","description":"bittorrent bencoding and decoding.","directories":{},"dependencies":{"bops":"~0.1.0","readable-stream":"~1.0.2"}},"0.4.0":{"name":"bncode","version":"0.4.0","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.4.0","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"contributors":[{"name":"Feross Aboukhadijeh","email":"feross@feross.org"},{"name":"Roly Fentanes","email":"roly426@gmail.com"},{"name":"Patrick Williams","email":"patrick@bittorrent.com"},{"name":"Clark Fischer","email":"clark.fischer@gmail.com"}],"homepage":"https://github.com/a2800276/bencode.js","bugs":{"url":"https://github.com/a2800276/bencode.js/issues"},"dist":{"shasum":"ca7eccd6fa090b4a16391ac05086cf019dc35c4b","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.4.0.tgz","integrity":"sha512-vtbi3wU01kSVrZQvVU9ZvLjUOpqzuFRDKuMbCv7u6+TKAGT+7147Kq/p7PPBHJoYUEwpVSs10kPXOwBYH/GqBQ==","signatures":[{"sig":"MEUCIQCnTc5csihvXSTDTfJ+Ty0n6/5SQasuwh7M/bkAjMft4QIgMiUcu0vJW2JNvq6VOobX4L4zppAGnSXpIwd1dWFiF+g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","_from":".","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"1.3.21","description":"bittorrent bencoding and decoding.","directories":{},"dependencies":{"bops":"~0.1.0"}},"0.5.0":{"name":"bncode","version":"0.5.0","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.5.0","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"contributors":[{"name":"Feross Aboukhadijeh","email":"feross@feross.org"},{"name":"Roly Fentanes","email":"roly426@gmail.com"},{"name":"Patrick Williams","email":"patrick@bittorrent.com"},{"name":"Clark Fischer","email":"clark.fischer@gmail.com"}],"homepage":"https://github.com/a2800276/bencode.js","bugs":{"url":"https://github.com/a2800276/bencode.js/issues"},"dist":{"shasum":"626c3abcd3661c1b93bdb7e9fb17e233907aa0c6","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.5.0.tgz","integrity":"sha512-TgUMLq0cajbtEmOcLhoNtC5ntavto6J/Q4aI4XwNn1lVLHvCSXGErthlZK8JAZmilOvOC2jiViPcmYOfZttfZQ==","signatures":[{"sig":"MEUCIQC5bQTprAPOCfA5EWu+6YNOn+ave61mfyzoB7cFcEZjvQIgeappseJM25C5I3Bo7ypUEFy7WnjYV1AWVNaimyKwCKc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bencode.js","_from":".","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bencode.js.git","type":"git"},"_npmVersion":"1.3.21","description":"bittorrent bencoding and decoding.","directories":{},"dependencies":{}},"0.5.1":{"name":"bncode","version":"0.5.1","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.5.1","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"contributors":[{"name":"Feross Aboukhadijeh","email":"feross@feross.org"},{"name":"Roly Fentanes","email":"roly426@gmail.com"},{"name":"Patrick Williams","email":"patrick@bittorrent.com"},{"name":"Clark Fischer","email":"clark.fischer@gmail.com"}],"homepage":"https://github.com/a2800276/bncode","bugs":{"url":"https://github.com/a2800276/bncode/issues"},"dist":{"shasum":"25fca04212ae431128fb567eb4966ac58027e5fe","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.5.1.tgz","integrity":"sha512-CWQpBBppUutB4GPwHAWep/q8xk+m1nTiLQFxT7CaDI6x/GQPBXbmyPgj9FIZmVkfdvLbij1Qpsv/F7HrTR3N0g==","signatures":[{"sig":"MEUCIQC/aMioNh8ciSE5sQb6tMsv7uKyyvT23o99hoHBUBSv8AIgcUNePYQAuUE9av/qQpJnVwqm1ln7cKe6ajHjqxMlnpY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bncode.js","_from":".","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bncode.git","type":"git"},"_npmVersion":"1.3.21","description":"bittorrent bencoding and decoding.","directories":{},"dependencies":{}},"0.5.2":{"name":"bncode","version":"0.5.2","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.5.2","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"contributors":[{"name":"Feross Aboukhadijeh","email":"feross@feross.org"},{"name":"Roly Fentanes","email":"roly426@gmail.com"},{"name":"Patrick Williams","email":"patrick@bittorrent.com"},{"name":"Clark Fischer","email":"clark.fischer@gmail.com"}],"homepage":"https://github.com/a2800276/bncode","bugs":{"url":"https://github.com/a2800276/bncode/issues"},"dist":{"shasum":"d20f51090df4f5ff5df58594d78ec9b25d84dead","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.5.2.tgz","integrity":"sha512-BGdTg+5QIkshBsV5KUDGEHFNWpQZXlLPXpiYx3BjVOTSJQdUPeXJqM1F3bJxReKH0RUAjr2LR7J+WiBC+sUhPA==","signatures":[{"sig":"MEUCICQCpnpYwpAwHnninxis/80qbuWxIpd9PP9CZhANnD0JAiEAvfYRZItATUvbShgVebj04P/WxaW8rVfsrgWMwZr/rPM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bncode.js","_from":".","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bncode.git","type":"git"},"_npmVersion":"1.3.21","description":"bittorrent bencoding and decoding.","dependencies":{},"directories":{}},"0.5.3":{"name":"bncode","version":"0.5.3","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"_id":"bncode@0.5.3","maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"contributors":[{"name":"Feross Aboukhadijeh","email":"feross@feross.org"},{"name":"Roly Fentanes","email":"roly426@gmail.com"},{"name":"Patrick Williams","email":"patrick@bittorrent.com"},{"name":"Clark Fischer","email":"clark.fischer@gmail.com"}],"homepage":"https://github.com/a2800276/bncode","bugs":{"url":"https://github.com/a2800276/bncode/issues"},"dist":{"shasum":"e16661697452d436bf9886238cc791b08d66a61a","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.5.3.tgz","integrity":"sha512-0P5VuWobU5Gwbeio8n9Jsdv0tE1IikrV9n4f7RsnXHNtxmdd/oeIO6QyoSEUAEyo5P6i3XMfBppi82WqNsT4JA==","signatures":[{"sig":"MEUCIFasbOvFoSaQndQ+ZfE2UNZHlQTcEgfJAiV/Zfd3jelPAiEA7sVZRM5DD2TOUKcRCzsGQ+heCmNkUNgcgjoyYLb4LL8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./bncode.js","_from":".","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"repository":{"url":"git://github.com/a2800276/bncode.git","type":"git"},"_npmVersion":"1.3.21","description":"bittorrent bencoding and decoding.","dependencies":{},"directories":{}},"0.6.0":{"name":"bncode","version":"0.6.0","description":"BitTorrent bencoding and decoding library for Node.js","author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"contributors":[{"name":"Feross Aboukhadijeh","email":"feross@feross.org"},{"name":"Roly Fentanes","email":"roly426@gmail.com"},{"name":"Patrick Williams","email":"patrick@bittorrent.com"},{"name":"Clark Fischer","email":"clark.fischer@gmail.com"}],"license":"MIT","type":"module","main":"./bncode.js","types":"./index.d.ts","exports":{".":{"import":"./bncode.js","types":"./index.d.ts"},"./package.json":"./package.json"},"repository":{"type":"git","url":"git://github.com/a2800276/bncode.git"},"bugs":{"url":"https://github.com/a2800276/bncode/issues"},"homepage":"https://github.com/a2800276/bncode#readme","keywords":["bencode","bencoding","bittorrent","torrent","encode","decode","parser","esm","deno","bun"],"engines":{"node":">=14.0.0"},"scripts":{"test":"node test/test.mjs","test:deno":"deno test --allow-read test/test-deno.js","test:bun":"bun test/test.mjs","test:all":"npm test && npm run test:deno && npm run test:bun"},"dependencies":{},"devDependencies":{},"gitHead":"4cc805dbfcb8c054a5677651ae086fe332ed7b3d","_id":"bncode@0.6.0","_nodeVersion":"25.6.0","_npmVersion":"11.8.0","dist":{"integrity":"sha512-X+H3feGBGNRJ/fKguoPAU9JfB4IY+gkGSpT5ieF7wz9eMSbfLJkNPNy8fPyRYu3m7tiA0YjKbM3zOOhNO2p4CA==","shasum":"ec4388ca12c8ecd22cc7dd3c05abb67e6ac7c4c7","tarball":"https://registry.npmjs.org/bncode/-/bncode-0.6.0.tgz","fileCount":27,"unpackedSize":191995,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDGhdmrMZUzjjaQ6XeEMclNyZg7SPEiwVHVYfULPC8DGgIhAIJJP82lVQL9MUkUIG02rbORAl4NEOaHK61FN/DNG+nM"}]},"_npmUser":{"name":"a2800276","email":"tim.becker@kuriositaet.de"},"directories":{},"maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bncode_0.6.0_1770647760460_0.8424084934479981"},"_hasShrinkwrap":false}},"time":{"created":"2011-02-26T19:51:05.660Z","modified":"2026-02-09T14:36:00.735Z","0.1.3":"2011-02-26T19:51:06.019Z","0.1.4":"2011-08-26T20:34:57.077Z","0.1.5":"2011-08-26T21:42:43.217Z","0.2.0":"2011-10-16T12:43:49.534Z","0.2.1":"2011-12-23T13:48:33.541Z","0.2.2":"2012-01-20T14:22:17.991Z","0.2.3":"2012-08-23T08:06:37.969Z","0.3.0":"2013-10-27T22:30:50.984Z","0.4.0":"2014-01-19T17:23:20.311Z","0.5.0":"2014-01-19T17:39:20.153Z","0.5.1":"2014-01-19T22:47:22.157Z","0.5.2":"2014-01-19T23:21:32.484Z","0.5.3":"2014-04-11T07:47:42.579Z","0.6.0":"2026-02-09T14:36:00.617Z"},"bugs":{"url":"https://github.com/a2800276/bncode/issues"},"author":{"name":"Tim Becker","email":"tim.becker@kuriositaet.de"},"homepage":"https://github.com/a2800276/bncode#readme","repository":{"type":"git","url":"git://github.com/a2800276/bncode.git"},"description":"BitTorrent bencoding and decoding library for Node.js","contributors":[{"name":"Feross Aboukhadijeh","email":"feross@feross.org"},{"name":"Roly Fentanes","email":"roly426@gmail.com"},{"name":"Patrick Williams","email":"patrick@bittorrent.com"},{"name":"Clark Fischer","email":"clark.fischer@gmail.com"}],"maintainers":[{"name":"a2800276","email":"tim.becker@kuriositaet.de"}],"readme":"[![build status](https://secure.travis-ci.org/a2800276/bncode.png)](http://travis-ci.org/a2800276/bncode)\n[![JSR](https://jsr.io/badges/@a2800276/bncode)](https://jsr.io/@a2800276/bncode)\n[![JSR Score](https://jsr.io/badges/@a2800276/bncode/score)](https://jsr.io/@a2800276/bncode)\n\n# bncode\n\nA BitTorrent bencoding and decoding library for Node.js, Deno, and Bun.\n\nBencoding is the encoding format used by BitTorrent, specified in [BEP\n3](http://www.bittorrent.org/beps/bep_0003.html).\n\n## Features\n\n-  Works in Node.js, Deno, and Bun\n-  TypeScript definitions included\n-  Zero dependencies\n-  Single file implementation\n\n### Installation\n\n```bash\nnpm install bncode\n```\n\n### ## Usage\n\n```javascript\nimport { encode, decode } from 'bncode'\n\nconst exmp = {\n  bla: 'blup',\n  foo: 'bar',\n  one: 1,\n  woah: {\n    arr: [1, 2, 3]\n  },\n  str: Buffer.from('Buffers work too')\n}\n\nconst bencBuffer = encode(exmp)\n\n// d3:bla4:blup3:foo3:bar3:onei1e4:woahd3:arr \\\n// li1ei2ei3eee3:str16:Buffers work tooe\n```\n\n## Decoding\n\nDecoding works progressively, e.g., if you're receiving partial\nbencoded strings on the network:\n\n```javascript\nconst bncode = require('bncode')\nlet buf = null\n\nconst decoder = new bncode.decoder()\nwhile (buf = receiveData()) {\n  decoder.decode(buf)\n}\n\nconsole.log(decoder.result())\n```\n\nOr \"all in one\":\n\n```javascript\nconst bncode = require('bncode')\nconst buf = getBuffer()\nconst dec = bncode.decode(buf)\n\nconsole.log(dec.bla)\n```\n\n### String Handling\n\nThere are some subtleties concerning bencoded strings. These are\ndecoded as Buffer objects because they are just strings of raw bytes\nand as such would wreak havoc with multi-byte strings in JavaScript.\n\nThe exception to this is strings appearing as keys in bencoded\ndictionaries. These are decoded as JavaScript Strings, as they should always\nbe strings of (ASCII) characters. If they weren't decoded as JS\nStrings, dictionaries couldn't be mapped to JavaScript objects.\n\n## Mapping bencoding to JavaScript\n\n     +----------------------------------------------------+\n     |                |                                   |\n     |  Bencoded      |    JavaScript                     |\n     |====================================================|\n     |  Strings       |    Node Buffers, unless they are  |\n     |                |    dictionary keys, in which case |\n     |                |    they become JavaScript Strings |\n     |----------------+-----------------------------------|\n     |  Integers      |    Number                         |\n     |----------------+-----------------------------------|\n     |  Lists         |    Array                          |\n     |----------------+-----------------------------------|\n     |  Dictionaries  |    Object                         |\n     |                |                                   |\n     +----------------------------------------------------+\n\n## Mapping JavaScript to bencoding\n\nThe code makes a best effort to encode JavaScript to bencoding. If you stick to basic \ntypes (Arrays, Objects with String keys and basic values, Strings, Buffers and Numbers) \nyou shouldn't encounter surprises. Expect surprises (mainly not being able to round-trip \nencode/decode) if you encode fancy data types.\n\n## Stream API\n\nA transform stream is also available:\n\n```javascript\nconst bncode = require('bncode')\nconst fs = require('fs')\n\nfs.createReadStream('file.torrent')\n  .pipe(new bncode.Stream())\n  .on('data', (data) => {\n    console.log(data)\n  })\n```\n\n## API\n\n### `bncode.encode(obj)`\n\nEncodes a JavaScript object into a bencoded Buffer.\n\n### `bncode.decode(buffer, [encoding])`\n\nDecodes a bencoded buffer into a JavaScript object.\n\n### `new bncode.decoder()`\n\nCreates a progressive decoder that can handle partial data.\n\n### `new bncode.Stream([options])`\n\nCreates a transform stream for decoding bencoded data.\n\n## Author\n\nbncode was written by Tim Becker (tim.becker@kuriositaet.de). I can be reached via \nemail or (preferably) submit a bug to the GitHub repository.\n\n## Thanks\n\n* Roly Fentanes (fent) for bug reports\n* Clark Fischer (clarkf)\n* The fine folks at Travis\n* Patrick Williams\n* Feross Aboukhadijeh\n\n## License\n\nMIT, see `LICENSE`\n","readmeFilename":"README.md","keywords":["bencode","bencoding","bittorrent","torrent","encode","decode","parser","esm","deno","bun"],"license":"MIT"}