{"_id":"bitfield","_rev":"237235","name":"bitfield","description":"a simple bitfield, compliant with the BitTorrent spec","dist-tags":{"latest":"4.1.0"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"time":{"modified":"2023-03-24T16:33:56.000Z","created":"2012-11-06T18:16:39.859Z","4.1.0":"2022-04-22T08:30:49.074Z","4.0.0":"2020-10-30T15:36:34.940Z","3.0.0":"2019-07-10T22:30:05.269Z","2.0.0":"2018-02-20T05:52:10.163Z","1.1.2":"2015-07-03T03:58:15.311Z","1.1.1":"2015-02-16T07:13:11.659Z","1.1.0":"2015-02-05T22:37:56.234Z","1.0.2":"2014-05-07T20:23:49.028Z","1.0.1":"2014-04-10T10:53:19.315Z","1.0.0":"2014-04-10T10:01:51.036Z","0.3.0":"2014-03-23T13:13:04.835Z","0.2.0":"2014-03-12T14:57:25.045Z","0.1.0":"2013-02-20T11:46:30.282Z","0.0.1":"2013-02-18T07:45:55.245Z","0.0.0":"2012-11-06T18:16:39.859Z"},"users":{},"author":{"name":"Felix Boehm","email":"me@feedic.com"},"repository":{"type":"git","url":"git+https://github.com/fb55/bitfield.git"},"versions":{"4.1.0":{"name":"bitfield","description":"a simple bitfield, compliant with the BitTorrent spec","version":"4.1.0","author":{"name":"Felix Boehm","email":"me@feedic.com"},"funding":{"url":"https://github.com/sponsors/fb55"},"sideEffects":false,"main":"lib/index.js","types":"lib/index.d.ts","module":"lib/esm/index.js","exports":{"require":"./lib/index.js","import":"./lib/esm/index.js"},"directories":{"lib":"lib/"},"bugs":{"url":"https://github.com/fb55/bitfield/issues"},"devDependencies":{"@types/jest":"^27.4.1","@types/node":"^17.0.25","@typescript-eslint/eslint-plugin":"^5.20.0","@typescript-eslint/parser":"^5.20.0","eslint":"^8.13.0","eslint-config-prettier":"^8.5.0","eslint-plugin-node":"^11.1.0","jest":"^27.5.1","prettier":"^2.6.2","ts-jest":"^27.1.4","typescript":"^4.6.3"},"engines":{"node":">=8"},"keywords":["bitfield","buffer","bittorrent"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fb55/bitfield.git"},"scripts":{"test":"npm run test:jest && npm run lint","test:jest":"jest","lint":"npm run lint:es && npm run lint:prettier","lint:es":"eslint .","lint:prettier":"npm run format:prettier:raw -- --check","format":"npm run format:es && npm run format:prettier","format:es":"npm run lint:es -- --fix","format:prettier":"npm run format:prettier:raw -- --write","format:prettier:raw":"prettier '**/*.{{m,c,}js,ts,md,json,yml}'","build":"npm run build:cjs && npm run build:esm","build:cjs":"tsc --sourceRoot https://raw.githubusercontent.com/fb55/bitfield/$(git rev-parse HEAD)/src/","build:esm":"npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json","prepare":"npm run build"},"jest":{"preset":"ts-jest","testEnvironment":"node"},"prettier":{"tabWidth":4},"gitHead":"597dd2c25d6aa18eb4d844a9ec42c4a2e9e51bbc","homepage":"https://github.com/fb55/bitfield#readme","_id":"bitfield@4.1.0","_nodeVersion":"17.9.0","_npmVersion":"8.5.5","dist":{"shasum":"77f3ef4e915e58adaf758b23cbff156959e0fd8e","size":5067,"noattachment":false,"key":"/bitfield/-/bitfield-4.1.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-4.1.0.tgz"},"_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bitfield_4.1.0_1650616248825_0.2694330432515446"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-22T08:59:08.132Z","publish_time":1650616249074,"_cnpm_publish_time":1650616249074},"4.0.0":{"name":"bitfield","description":"a simple bitfield, compliant with the BitTorrent spec","version":"4.0.0","author":{"name":"Felix Boehm","email":"me@feedic.com"},"funding":{"url":"https://github.com/sponsors/fb55"},"sideEffects":false,"main":"lib/index.js","types":"lib/index.d.ts","directories":{"lib":"lib/"},"bugs":{"url":"https://github.com/fb55/bitfield/issues"},"devDependencies":{"@types/jest":"^26.0.0","@types/node":"^14.11.8","@typescript-eslint/eslint-plugin":"^4.4.1","@typescript-eslint/parser":"^4.4.1","coveralls":"*","eslint":"^7.11.0","eslint-config-prettier":"^6.0.0","eslint-plugin-node":"^11.1.0","jest":"^26.5.3","prettier":"^2.0.5","ts-jest":"^26.1.0","typescript":"^4.0.2"},"engines":{"node":">=8"},"keywords":["bitfield","buffer","bittorrent"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fb55/bitfield.git"},"scripts":{"test":"jest --coverage && npm run lint","coverage":"cat coverage/lcov.info | coveralls","lint":"npm run lint:es && npm run lint:prettier","lint:es":"eslint .","lint:prettier":"npm run prettier -- --check","format":"npm run format:es && npm run format:prettier","format:es":"npm run lint:es -- --fix","format:prettier":"npm run prettier -- --write","prettier":"prettier '**/*.{js,ts,md,json,yml}'","build":"tsc","prepare":"npm run build"},"jest":{"preset":"ts-jest","testEnvironment":"node"},"prettier":{"tabWidth":4},"gitHead":"75b7eb70caa5603421037943c3616565a9f353e4","homepage":"https://github.com/fb55/bitfield#readme","_id":"bitfield@4.0.0","_nodeVersion":"15.0.1","_npmVersion":"7.0.3","dist":{"shasum":"3094123c870030dc6198a283d779639bd2a8e256","size":4001,"noattachment":false,"key":"/bitfield/-/bitfield-4.0.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-4.0.0.tgz"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"_npmUser":{"name":"feedic","email":"me@feedic.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bitfield_4.0.0_1604072194788_0.6582520568726633"},"_hasShrinkwrap":false,"publish_time":1604072194940,"_cnpm_publish_time":1604072194940,"_cnpmcore_publish_time":"2021-12-17T00:24:26.287Z"},"3.0.0":{"name":"bitfield","description":"a very simple bitfield implementation using buffers","version":"3.0.0","author":{"name":"Felix Boehm","email":"me@feedic.com"},"bugs":{"url":"https://github.com/fb55/bitfield/issues"},"devDependencies":{"standard":"^12.0.1","tape":"~4.11.0"},"engines":{"node":">=8"},"keywords":["bitfield","buffer"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"git+https://github.com/fb55/bitfield.git"},"scripts":{"test":"standard && tape tests.js"},"gitHead":"089a5e88bce38059444fb18e1f7d48a974a05060","homepage":"https://github.com/fb55/bitfield#readme","_id":"bitfield@3.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.10.0","dist":{"shasum":"b2d32c707866d42f016ae9bd8469999a9f51b59c","size":2222,"noattachment":false,"key":"/bitfield/-/bitfield-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-3.0.0.tgz"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"_npmUser":{"name":"feross","email":"feross@feross.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bitfield_3.0.0_1562797805025_0.9306880264885444"},"_hasShrinkwrap":false,"publish_time":1562797805269,"_cnpm_publish_time":1562797805269,"_cnpmcore_publish_time":"2021-12-17T00:24:26.678Z"},"2.0.0":{"name":"bitfield","description":"a very simple bitfield implementation using buffers","version":"2.0.0","author":{"name":"Felix Boehm","email":"me@feedic.com"},"bugs":{"url":"https://github.com/fb55/bitfield/issues"},"devDependencies":{"standard":"^11.0.0","tape":"~4.9.0"},"keywords":["bitfield","buffer"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"git+https://github.com/fb55/bitfield.git"},"scripts":{"test":"standard && tape tests.js"},"gitHead":"af94765651c5c6993506c2aec2cd6ee8d8595142","homepage":"https://github.com/fb55/bitfield#readme","_id":"bitfield@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"feross","email":"feross@feross.org"},"dist":{"shasum":"fbe6767592fe5b4c87ecf1d04126294cc1bfa837","size":3232,"noattachment":false,"key":"/bitfield/-/bitfield-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-2.0.0.tgz"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bitfield_2.0.0_1519105929978_0.9778634192858295"},"_hasShrinkwrap":false,"publish_time":1519105930163,"_cnpm_publish_time":1519105930163,"_cnpmcore_publish_time":"2021-12-17T00:24:26.865Z"},"1.1.2":{"name":"bitfield","version":"1.1.2","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"git+https://github.com/fb55/bitfield.git"},"scripts":{"test":"tape tests.js"},"keywords":["bitfield","buffer"],"devDependencies":{"tape":"2.12"},"testling":{"files":"tests.js","browsers":["ie/9..latest","chrome/25..latest","firefox/20..latest","safari/6..latest","opera/15.0..latest"]},"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","gitHead":"c0ea56e6b06442711b998ab025d2c280b661303e","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield#readme","_id":"bitfield@1.1.2","_shasum":"a5477f00e33f2a76edc209aaf26bf09394a378cf","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"feross","email":"feross@feross.org"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"dist":{"shasum":"a5477f00e33f2a76edc209aaf26bf09394a378cf","size":3352,"noattachment":false,"key":"/bitfield/-/bitfield-1.1.2.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-1.1.2.tgz"},"directories":{},"publish_time":1435895895311,"_hasShrinkwrap":false,"_cnpm_publish_time":1435895895311,"_cnpmcore_publish_time":"2021-12-17T00:24:27.042Z"},"1.1.1":{"name":"bitfield","version":"1.1.1","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"scripts":{"test":"tape tests.js"},"keywords":["bitfield","buffer"],"devDependencies":{"tape":"2.12"},"testling":{"files":"tests.js","browsers":["ie/9..latest","chrome/25..latest","firefox/20..latest","safari/6..latest","opera/15.0..latest"]},"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","gitHead":"e54e6dd540e7c527f31f04668107ed4ea4b75489","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield","_id":"bitfield@1.1.1","_shasum":"c09c9cb352183a1d900f907ec0a8b6138520eb48","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.2.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"dist":{"shasum":"c09c9cb352183a1d900f907ec0a8b6138520eb48","size":3332,"noattachment":false,"key":"/bitfield/-/bitfield-1.1.1.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-1.1.1.tgz"},"directories":{},"publish_time":1424070791659,"_hasShrinkwrap":false,"_cnpm_publish_time":1424070791659,"_cnpmcore_publish_time":"2021-12-17T00:24:27.235Z"},"1.1.0":{"name":"bitfield","version":"1.1.0","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"scripts":{"test":"tape tests.js"},"keywords":["bitfield","buffer"],"devDependencies":{"tape":"2.12"},"testling":{"files":"tests.js","browsers":["ie/9..latest","chrome/25..latest","firefox/20..latest","safari/6..latest","opera/15.0..latest"]},"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","gitHead":"165c0e3ad7847cd3f7bc4198126b99e3a6089de7","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield","_id":"bitfield@1.1.0","_shasum":"d441e1462e1027d523dd6569cd0229521ee7fdd1","_from":".","_npmVersion":"2.4.1","_nodeVersion":"0.10.36","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"dist":{"shasum":"d441e1462e1027d523dd6569cd0229521ee7fdd1","size":3343,"noattachment":false,"key":"/bitfield/-/bitfield-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-1.1.0.tgz"},"directories":{},"publish_time":1423175876234,"_hasShrinkwrap":false,"_cnpm_publish_time":1423175876234,"_cnpmcore_publish_time":"2021-12-17T00:24:27.451Z"},"1.0.2":{"name":"bitfield","version":"1.0.2","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"scripts":{"test":"tape tests.js"},"keywords":["bitfield","buffer"],"devDependencies":{"tape":"2.12"},"testling":{"files":"tests.js","browsers":["ie/9..latest","chrome/25..latest","firefox/20..latest","safari/6..latest","opera/15.0..latest"]},"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield","_id":"bitfield@1.0.2","_shasum":"3d3ec02d180a54cefb57359adcbf99d3b8392448","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"dist":{"shasum":"3d3ec02d180a54cefb57359adcbf99d3b8392448","size":3302,"noattachment":false,"key":"/bitfield/-/bitfield-1.0.2.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-1.0.2.tgz"},"directories":{},"publish_time":1399494229028,"_hasShrinkwrap":false,"_cnpm_publish_time":1399494229028,"_cnpmcore_publish_time":"2021-12-17T00:24:27.657Z"},"1.0.1":{"name":"bitfield","version":"1.0.1","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"scripts":{"test":"tape tests.js"},"keywords":["bitfield","buffer"],"devDependencies":{"tape":"2.12"},"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield","_id":"bitfield@1.0.1","dist":{"shasum":"236a6711e7344d362563b35fe70c7ac3033360ff","size":3090,"noattachment":false,"key":"/bitfield/-/bitfield-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-1.0.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"publish_time":1397127199315,"_hasShrinkwrap":false,"_cnpm_publish_time":1397127199315,"_cnpmcore_publish_time":"2021-12-17T00:24:27.860Z"},"1.0.0":{"name":"bitfield","version":"1.0.0","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"scripts":{"test":"node tests.js"},"keywords":["bitfield","buffer"],"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield","_id":"bitfield@1.0.0","dist":{"shasum":"d05209e05b26e11537d1e36d10236294b1511746","size":2926,"noattachment":false,"key":"/bitfield/-/bitfield-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-1.0.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"publish_time":1397124111036,"_hasShrinkwrap":false,"_cnpm_publish_time":1397124111036,"_cnpmcore_publish_time":"2021-12-17T00:24:28.094Z"},"0.3.0":{"name":"bitfield","version":"0.3.0","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"scripts":{"test":"node tests.js"},"keywords":["bitfield","buffer"],"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield","_id":"bitfield@0.3.0","dist":{"shasum":"5d33809c5df051ef6089111ce1bf440691202d6f","size":2621,"noattachment":false,"key":"/bitfield/-/bitfield-0.3.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-0.3.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"publish_time":1395580384835,"_hasShrinkwrap":false,"_cnpm_publish_time":1395580384835,"_cnpmcore_publish_time":"2021-12-17T00:24:28.306Z"},"0.2.0":{"name":"bitfield","version":"0.2.0","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"scripts":{"test":"node tests.js"},"keywords":["bitfield","buffer"],"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"MIT","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"homepage":"https://github.com/fb55/bitfield","_id":"bitfield@0.2.0","dist":{"shasum":"2aaee32a457bbc18da0bc7f11cf68d38cc5ceece","size":2557,"noattachment":false,"key":"/bitfield/-/bitfield-0.2.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-0.2.0.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"publish_time":1394636245045,"_hasShrinkwrap":false,"_cnpm_publish_time":1394636245045,"_cnpmcore_publish_time":"2021-12-17T00:24:28.530Z"},"0.1.0":{"name":"bitfield","version":"0.1.0","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"keywords":["bitfield","buffer"],"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"-","readmeFilename":"readme.md","_id":"bitfield@0.1.0","dist":{"shasum":"b05d8b5f0d09f2df35a9db3b3a62d3808c46c457","size":1059,"noattachment":false,"key":"/bitfield/-/bitfield-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-0.1.0.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"publish_time":1361360790282,"_hasShrinkwrap":false,"_cnpm_publish_time":1361360790282,"_cnpmcore_publish_time":"2021-12-17T00:24:28.734Z"},"0.0.1":{"name":"bitfield","version":"0.0.1","description":"a very simple bitfield implementation using buffers","main":"index.js","repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"keywords":["bitfield","buffer"],"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"-","readmeFilename":"readme.md","_id":"bitfield@0.0.1","dist":{"shasum":"e92c436a6e3463111e0d4d39cfeda7321e1da7c5","size":1026,"noattachment":false,"key":"/bitfield/-/bitfield-0.0.1.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"publish_time":1361173555245,"_hasShrinkwrap":false,"_cnpm_publish_time":1361173555245,"_cnpmcore_publish_time":"2021-12-17T00:24:28.919Z"},"0.0.0":{"name":"bitfield","version":"0.0.0","description":"a very simple bitfield implementation using buffers","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"https://github.com/fb55/bitfield"},"keywords":["bitfield","buffer"],"author":{"name":"Felix Boehm","email":"me@feedic.com"},"license":"-","readmeFilename":"readme.md","_id":"bitfield@0.0.0","dist":{"shasum":"c65aa14d405c77f76d26f976dc869f6bea39794a","size":1028,"noattachment":false,"key":"/bitfield/-/bitfield-0.0.0.tgz","tarball":"http://name.csiicloud.com:7001/bitfield/download/bitfield-0.0.0.tgz"},"_npmVersion":"1.1.65","_npmUser":{"name":"feedic","email":"me@feedic.com"},"maintainers":[{"name":"feedic","email":""},{"name":"feross","email":""},{"name":"mafintosh","email":""}],"directories":{},"publish_time":1352225799859,"_hasShrinkwrap":false,"_cnpm_publish_time":1352225799859,"_cnpmcore_publish_time":"2021-12-17T00:24:29.187Z"}},"readme":"# bitfield\n\nA simple bitfield, compliant with the BitTorrent spec.\n\n    npm install bitfield\n\n#### Example\n\n```js\nimport Bitfield from \"bitfield\";\n\nconst field = new Bitfield(256); // Create a bitfield with 256 bits.\n\nfield.set(128); // Set the 128th bit.\nfield.set(128, true); // Same as above.\n\nfield.get(128); // `true`\nfield.get(200); // `false` (all values are initialised to `false`)\nfield.get(1e3); // `false` (out-of-bounds is also false)\n\nfield.set(128, false); // Set the 128th bit to 0 again.\n\nfield.buffer; // The buffer used by the bitfield.\n```\n\n## Class: BitField\n\n### Constructors\n\n-   [constructor](#constructor)\n\n### Properties\n\n-   [buffer](#buffer)\n\n### Methods\n\n-   [forEach](#foreach)\n-   [get](#get)\n-   [set](#set)\n\n## Constructors\n\n### constructor\n\n\\+ **new BitField**(`data?`: number \\| Uint8Array, `opts?`: BitFieldOptions): `BitField`\n\n#### Parameters:\n\n| Name    | Type                 | Default value | Description                                                                                                                                                                                                                                                       |\n| ------- | -------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `data`  | number \\| Uint8Array | 0             | Either a number representing the maximum number of supported bytes, or a Uint8Array.                                                                                                                                                                              |\n| `opts?` | { grow: number }     | { grow: 0 }   | <p>**grow:**<p>If you `set` an index that is out-of-bounds, the bitfield will automatically grow so that the bitfield is big enough to contain the given index, up to the given size (in bit). <p>If you want the Bitfield to grow indefinitely, pass `Infinity`. |\n\n**Returns:** `BitField`\n\n## Properties\n\n### buffer\n\n• **buffer**: Uint8Array\n\nThe internal storage of the bitfield.\n\n## Methods\n\n### forEach\n\n▸ **forEach**(`fn`: (bit: boolean, index: number) => void, `start?`: number, `end?`: number): void\n\nLoop through the bits in the bitfield.\n\n#### Parameters:\n\n| Name    | Type                                  | Default value           | Description                                                 |\n| ------- | ------------------------------------- | ----------------------- | ----------------------------------------------------------- |\n| `fn`    | (bit: boolean, index: number) => void | -                       | Function to be called with the bit value and index.         |\n| `start` | number                                | 0                       | Index of the first bit to look at.                          |\n| `end`   | number                                | this.buffer.length \\* 8 | Index of the first bit that should no longer be considered. |\n\n**Returns:** void\n\n---\n\n### get\n\n▸ **get**(`i`: number): boolean\n\nGet a particular bit.\n\n#### Parameters:\n\n| Name | Type   | Description            |\n| ---- | ------ | ---------------------- |\n| `i`  | number | Bit index to retrieve. |\n\n**Returns:** boolean\n\nA boolean indicating whether the `i`th bit is set.\n\n---\n\n### set\n\n▸ **set**(`i`: number, `value?`: boolean): void\n\nSet a particular bit.\n\nWill grow the underlying array if the bit is out of bounds and the `grow` option is set.\n\n#### Parameters:\n\n| Name    | Type    | Default value | Description                                  |\n| ------- | ------- | ------------- | -------------------------------------------- |\n| `i`     | number  | -             | Bit index to set.                            |\n| `value` | boolean | true          | Value to set the bit to. Defaults to `true`. |\n\n**Returns:** void\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/fb55/bitfield#readme","bugs":{"url":"https://github.com/fb55/bitfield/issues"},"license":"MIT"}