{"name":"quickbit-native","version":"1.1.0","description":"libquickbit JavaScript bindings for Node.js","main":"index.js","scripts":{"test":"standard && brittle test.mjs","prebuild":"prebuildify --napi","install":"node-gyp-build"},"repository":{"type":"git","url":"git+https://github.com/holepunchto/quickbit-native.git"},"author":{"name":"Kasper Isager Dalsgarð","email":"kasper@funktionel.co"},"license":"ISC","bugs":{"url":"https://github.com/holepunchto/quickbit-native/issues"},"homepage":"https://github.com/holepunchto/quickbit-native#readme","dependencies":{"b4a":"^1.6.0","napi-macros":"^2.0.0","node-gyp-build":"^4.2.3"},"devDependencies":{"brittle":"^3.1.0","prebuildify":"^5.0.1","standard":"^17.0.0"},"gitHead":"dba7f97090d66af5d4b959734c8e7a8733ddafe3","_id":"quickbit-native@1.1.0","_nodeVersion":"18.7.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-suahm0Pq6+XEcaKfQHeOgmqq+2jvsiOF7j4beXFMJThYdQBRCgma+VtCe2q4H+slmAvCpPX9GZ1kcEyn9RAJrg==","shasum":"05f04ebe0bab086473ef034d351bbd1e72cef8e7","tarball":"http://registry-npm.ywwl.com/quickbit-native/download/quickbit-native-1.1.0.tgz","fileCount":30,"unpackedSize":278267,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLj82R3TELDAV0ytcZjtjQ40y/U9WuTuGUU8CNnvUZLAIgfSNAm6m3oOEw3eKVvlPo7znIvRczNqgjiMawugnHrRs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjFwESACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRiQ/+Pq4pYJY6vbuYs5r9WxUpLEy+Gv2mGSiaQyyRQQUWPGg+poni\r\nG3DcC/Bk8WUKnGTKuuHCJzxBsJE1ytDuaOe1MfYZS5bTWNkITC6jG9kDqUsy\r\nMB23iq9ymP84trAmTB2duhrLCp0M5eb1pAWNL4254vzvsy28MF3FtJq4uC8U\r\nRrrK6Cy3jxGkk5wnsC/eM5WwRIlzeVkWkwJg7M5NjEn3UkuWJ8l8J3UVskQG\r\n/SVrz3HcFTaELNxdpCJav6dcJoA4g0xZhpzI1iAvltGfkP8+wkxo0BV0uv0Q\r\nTJdF/vV08CG5MQvC1Y674niYSx5qewkpbVnf6u1gtkvZjtkjs1sdJ+FvSpDM\r\nksbQrld4V1/Ay96gKTkxU+hQk/L1j7f1/v4JsqthazpXxTkcpSXf9sUJP8uj\r\nysQ6w+7a9kWbX5DaGCX5nvI7T6PhuctDrsms6nRuAOC8FoYxS+t7Y1WMtUOW\r\nksgkkraidPLArv1C0dzNwWzNf4JeuoHpQtDAggW3u3eW9fgDavEzYVEoHbsD\r\nougY4zvPe6DvFWBwKJh2JbKkt5YIxK3HuZB6HM+B17VCl+mrKYJXQyoISQ3H\r\nm2mXvZCQRrUKVx493ArR3tTA0KlsavogPMaNkcNUlK/aYYttlF4xaKUqjxXs\r\nM8dYnSdj/SGxONtIrtBjMIOsnQne9NoFAO8=\r\n=gFdw\r\n-----END PGP SIGNATURE-----\r\n","size":82476,"noattachment":false,"key":"/quickbit-native/-/quickbit-native-1.1.0.tgz"},"_npmUser":{"name":"kasperisager","email":"kasperisager@hey.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"kasperisager","email":"kasperisager@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quickbit-native_1.1.0_1662451985855_0.12915738359884976"},"_hasShrinkwrap":false,"readme":"# quickbit-native\n\nhttps://github.com/holepunchto/libquickbit JavaScript bindings for Node.js.\n\n```sh\nnpm install quickbit-native\n```\n\n## Usage\n\n```js\nconst { get, set, findFirst } = require('quickbit-native')\n\nconst field = Buffer.alloc(256) // 2048 bits\n\nconst changed = set(field, 1000)\n// true\n\nget(field, 1000)\n// true\n\nfindFirst(field, true)\n// 1000\n```\n\n## API\n\n#### `const b = get(field, bit)`\n\nGet the given bit, which will either be `true` (set) or `false` (unset).\n\n#### `const changed = set(field, bit[, value])`\n\nSet the given bit to `value`, which defaults to `true`. Returns `true` if the bit changed, otherwise `false`.\n\n#### `field = fill(field, value[, start[, end]])`\n\nFill the given bit range with `value`. `start` defaults to `0` and `end` defaults to the bit length of the field. Returns the modified field.\n\n#### `clear(field, chunk)`\n\nClear the bits from `field` that are set in the `{ field, offset }` chunk.\n\n#### `const i = findFirst(field, value[, position])`\n\nReturn the index of the first occurrence of `value`, or `-1` if not found. If `position` is given, return the first index that is greater than or equal to `position`.\n\n#### `const i = findLast(field, value[, position])`\n\nReturn the index of the last occurrence of `value`, or `-1` if not found. If `position` is given, return the last index that is less than or equal to `position`.\n\n### Indexing\n\n#### `const index = Index.from(fieldOrChunks)`\n\nConstruct an index of the bits in a bit field or an array of sparse `{ field, offset }` chunks.\n\n#### `const changed = index.update(bit)`\n\nUpdate the given bit in the index.\n\n#### `const position = index.skipFirst(value[, position])`\n\nSkip the first parts of the index that contain nothing but `value`. If the index contains *only* `value`, the last index of the field is returned.\n\n#### `const position = index.skipLast(value[, position])`\n\nSkip the last parts of the index that contain nothing but `value`. If the index contains *only* `value`, the first index of the field is returned.\n\n## License\n\nApache-2.0\n","publish_time":1662451986031,"_cnpm_publish_time":1662451986031,"dist-tags":{"latest":"2.4.9"}}