{"_id":"quickbit-native@2.4.9","bugs":{"url":"https://github.com/holepunchto/quickbit-native/issues"},"dist":{"shasum":"a91d0dc98bb19819f691c6046c1ac7a89ec8adea","tarball":"http://registry-npm.ywwl.com/quickbit-native/download/quickbit-native-2.4.9.tgz","fileCount":30,"integrity":"sha512-qATuRZw3TN5JajRZs02SlolPLutmUJ4kpxF7ZWdbLnWu0Ifl0XVD9H44JdT1T+HvRDdC9fZinXticJJ7+BR7hg==","signatures":[{"sig":"MEYCIQD41kdWaMQURukadFmzzPbJowPRlduaxxfPR1DhC/SqAwIhAMWemh+xNQ+T05XAQJ9Tka8GzSEu6KsAetUXsVwS6UF8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDyf2uJ0PI+NqiYjYJbxIB9lnK7f9XWFKb48vldLCK/sgIhAM0waKH6vWKM8q1WWVI8A8jJRRiVjb/3/J8jhorAGW0c"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/quickbit-native@2.4.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1923637,"size":664470,"noattachment":false,"key":"/quickbit-native/-/quickbit-native-2.4.9.tgz"},"main":"index.js","name":"quickbit-native","addon":true,"author":{"name":"Holepunch"},"gitHead":"b5285a5c0e7d19dba197a2ad3e60bbab581bb2fb","license":"Apache-2.0","scripts":{"lint":"prettier --check . && lunte","test":"npm run test:bare && npm run test:node","format":"prettier --write . && lunte --fix","test:bare":"brittle-bare --coverage test.mjs","test:node":"brittle-node --coverage test.mjs"},"version":"2.4.9","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:429ed370-73fb-4767-8b2a-e6384443c62b"}},"homepage":"https://github.com/holepunchto/quickbit-native#readme","repository":{"url":"git+https://github.com/holepunchto/quickbit-native.git","type":"git"},"_npmVersion":"11.19.0","description":"libquickbit JavaScript bindings for Node.js","directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_nodeVersion":"24.21.0","dependencies":{"require-addon":"^1.1.0"},"_hasShrinkwrap":false,"devDependencies":{"b4a":"^1.6.7","lunte":"^1.8.4","brittle":"^3.1.0","prettier":"^3.5.3","cmake-bare":"^1.1.7","cmake-napi":"^1.0.2","cmake-fetch":"^1.1.0","bare-compat-napi":"^1.3.2","prettier-config-holepunch":"^2.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/quickbit-native_2.4.9_1790256461131_0.10918963467894138"},"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":1790256461248,"_cnpm_publish_time":1790256461248,"dist-tags":{"latest":"2.4.9"}}