{"_id":"@arcanyx/cidr-slicer","_rev":"4-6cde42471983a2e4de2b12c16af51c38","name":"@arcanyx/cidr-slicer","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"@arcanyx/cidr-slicer","version":"0.1.0","keywords":["cidr","ipv6","subnets"],"author":{"name":"Joe Dahlquist","email":"joe@arcanyx.com"},"license":"MIT","_id":"@arcanyx/cidr-slicer@0.1.0","maintainers":[{"name":"jdahlq","email":"joe@arcanyx.com"}],"homepage":"https://github.com/arcanyx-pub/cidr-slicer-ts","bugs":{"url":"https://github.com/arcanyx-pub/cidr-slicer-ts/issues"},"dist":{"shasum":"6b82c24cdebacee1f71a7a4051dab96388b6efa3","tarball":"https://registry.npmjs.org/@arcanyx/cidr-slicer/-/cidr-slicer-0.1.0.tgz","fileCount":26,"integrity":"sha512-KYf+0hqdcgooPTJBRLrRgWCQP61PgJKWj40CY/m8Y7VXqeO7x2ousSzcr6jn9aJIRN5b+24NI9tCQcZB9Enw/w==","signatures":[{"sig":"MEUCIQCuX1zGJ4VGqxLMqM/t6OLN/33NdkAtmqMXRIgvOLTIcAIgaaUMoiFg8dlzpOhicUfQqF76NUckF/gHLGvijsat9mE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61126},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"d6955bf7b13605b480b24f7f333ed75950f02d29","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"jdahlq","email":"joe@arcanyx.com"},"repository":{"url":"git+https://github.com/arcanyx-pub/cidr-slicer-ts.git","type":"git"},"_npmVersion":"9.6.4","description":"Lib for partitioning IPv4 and IPv6 CIDR blocks into smaller slices.","directories":{},"_nodeVersion":"20.0.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","typescript":"^5.0.4","@jest/globals":"^29.5.0"},"_npmOperationalInternal":{"tmp":"tmp/cidr-slicer_0.1.0_1685223980065_0.09384721766509929","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@arcanyx/cidr-slicer","version":"0.2.0","keywords":["cidr","ipv6","subnets"],"author":{"name":"Joe Dahlquist","email":"joe@arcanyx.com"},"license":"MIT","_id":"@arcanyx/cidr-slicer@0.2.0","maintainers":[{"name":"jdahlq","email":"joe@arcanyx.com"}],"homepage":"https://github.com/arcanyx-pub/cidr-slicer-ts","bugs":{"url":"https://github.com/arcanyx-pub/cidr-slicer-ts/issues"},"dist":{"shasum":"922919761eff9426b96e10c8ef535271f8020ec6","tarball":"https://registry.npmjs.org/@arcanyx/cidr-slicer/-/cidr-slicer-0.2.0.tgz","fileCount":23,"integrity":"sha512-bXtAxaJhHPrbMNuFIjaLx0UTRtoCGDeV5Ob3pg9phInWJ/8e9ERB9S1ZN5LcL+oxLLw5yz1Mxmiy9dw8RYxaEA==","signatures":[{"sig":"MEYCIQD4SAjHY9LMgZSwX7wkf2BHVsaSwaW48sSbK19SLkYS3gIhAPNVUxXbPZocNQTmuJiCaYAKbg/ZD63cBysYQsHVZfBo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":48996},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"c055318423006baa9c55227ec4b2da74b402d623","scripts":{"lint":"eslint .","test":"jest --verbose","build":"tsc --project tsconfig.build.json --listEmittedFiles"},"_npmUser":{"name":"jdahlq","email":"joe@arcanyx.com"},"repository":{"url":"git+https://github.com/arcanyx-pub/cidr-slicer-ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Lib for partitioning IPv4 and IPv6 CIDR blocks into smaller slices.","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.41.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","typescript":"^5.0.4","@jest/globals":"^29.5.0","@arcanyx/eslint-config-ts":"^1.0.0","@typescript-eslint/parser":"^5.59.8","@typescript-eslint/eslint-plugin":"^5.59.8"},"_npmOperationalInternal":{"tmp":"tmp/cidr-slicer_0.2.0_1685740074586_0.12005109318378615","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"@arcanyx/cidr-slicer","version":"0.3.0","keywords":["cidr","ipv6","subnets"],"author":{"name":"Joe Dahlquist","email":"joe@arcanyx.com"},"license":"MIT","_id":"@arcanyx/cidr-slicer@0.3.0","maintainers":[{"name":"jdahlq","email":"joe@arcanyx.com"}],"homepage":"https://github.com/arcanyx-pub/cidr-slicer-ts","bugs":{"url":"https://github.com/arcanyx-pub/cidr-slicer-ts/issues"},"dist":{"shasum":"184801de8a42b8a4fceaf43c7a52ee4cbf0d068e","tarball":"https://registry.npmjs.org/@arcanyx/cidr-slicer/-/cidr-slicer-0.3.0.tgz","fileCount":41,"integrity":"sha512-Rr5Fdh1akBmhLkiJLCHnTZI8mLXA07uJs4kVX24kzgPW4TVVliHNciU7P0DCEQR4E9UiTQYbLFWx2+8ohsyp2w==","signatures":[{"sig":"MEYCIQC314xeJDhN6YmviOlVP3SkhbB11aapoxOqVcMETfVTCwIhAJ5c7NGoyHQkftfL52R9SBFQWb5UGQ8MURyotoybse/b","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":78635},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"5ab32938563c3c13535996c67872031c4a507f40","scripts":{"lint":"eslint .","test":"jest --verbose","build":"tsc --project tsconfig.build.json --listEmittedFiles","publish":"npm run build && npm publish"},"_npmUser":{"name":"jdahlq","email":"joe@arcanyx.com"},"repository":{"url":"git+https://github.com/arcanyx-pub/cidr-slicer-ts.git","type":"git"},"_npmVersion":"9.5.1","description":"Lib for partitioning IPv4 and IPv6 CIDR blocks into smaller slices.","directories":{},"_nodeVersion":"18.16.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.41.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","typescript":"^5.0.4","@jest/globals":"^29.5.0","@arcanyx/eslint-config-ts":"^1.0.0","@typescript-eslint/parser":"^5.59.8","@typescript-eslint/eslint-plugin":"^5.59.8"},"_npmOperationalInternal":{"tmp":"tmp/cidr-slicer_0.3.0_1685740577149_0.21528054396389584","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"@arcanyx/cidr-slicer","version":"1.0.0","description":"Lib for partitioning IPv4 and IPv6 CIDR blocks into smaller slices.","type":"module","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.js"}},"./package.json":"./package.json"},"main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","engines":{"node":">=22"},"scripts":{"clean":"node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"","build:esm":"tsc -p tsconfig.esm.json","build:cjs":"tsc -p tsconfig.cjs.json","build":"npm run clean && npm run build:esm && npm run build:cjs && node scripts/finalize-dist.mjs","typecheck":"tsc --noEmit","test":"vitest run","lint":"biome check","format":"biome check --write","check:exports":"node scripts/check-exports.mjs"},"repository":{"type":"git","url":"git+https://github.com/arcanyx-pub/cidr-slicer-ts.git"},"homepage":"https://github.com/arcanyx-pub/cidr-slicer-ts","keywords":["cidr","ipv6","subnets"],"author":{"name":"Joe Dahlquist","email":"joe@arcanyx.com"},"license":"MIT","publishConfig":{"access":"public"},"devDependencies":{"@arcanyx/biome-config":"^0.1.2","@biomejs/biome":"^2.5.3","typescript":"^7.0.2","vitest":"^4.1.10"},"gitHead":"5cb03c3114616499afd4de8eb423b99b0604e8b3","_id":"@arcanyx/cidr-slicer@1.0.0","bugs":{"url":"https://github.com/arcanyx-pub/cidr-slicer-ts/issues"},"_nodeVersion":"24.18.0","_npmVersion":"12.0.1","dist":{"integrity":"sha512-w2fkbNiDK3cBJ+p1NO4ToX7pjR+m0NB0T+VJRMVPUVyl2QJDViHCM6oWeRsmWaLuZcAyzQdAnxTAo7QyrwMRrw==","shasum":"164d23b8a9b7984205f68e4f40582d3865e837b7","tarball":"https://registry.npmjs.org/@arcanyx/cidr-slicer/-/cidr-slicer-1.0.0.tgz","fileCount":41,"unpackedSize":102129,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arcanyx%2fcidr-slicer@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCGyvqgN+2/V9cKR67k964t1G1IlpKM18DUfweDhDQD5gIgZEYPVHGFud2dImY5toe+sa2llUJpdYML9eyyo1/Rmf0="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:527555c1-54f0-4127-b2ec-35bf2757380e"}},"directories":{},"maintainers":[{"name":"jdahlq","email":"joe@arcanyx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cidr-slicer_1.0.0_1784469353867_0.4410736142676577"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-27T21:46:20.002Z","modified":"2026-07-19T13:55:54.356Z","0.1.0":"2023-05-27T21:46:20.242Z","0.2.0":"2023-06-02T21:07:54.751Z","0.3.0":"2023-06-02T21:16:17.330Z","1.0.0":"2026-07-19T13:55:53.997Z"},"bugs":{"url":"https://github.com/arcanyx-pub/cidr-slicer-ts/issues"},"author":{"name":"Joe Dahlquist","email":"joe@arcanyx.com"},"license":"MIT","homepage":"https://github.com/arcanyx-pub/cidr-slicer-ts","keywords":["cidr","ipv6","subnets"],"repository":{"type":"git","url":"git+https://github.com/arcanyx-pub/cidr-slicer-ts.git"},"description":"Lib for partitioning IPv4 and IPv6 CIDR blocks into smaller slices.","maintainers":[{"name":"jdahlq","email":"joe@arcanyx.com"}],"readme":"CIDR::/slicer 🔪🍎\n================\n\n[![npm](https://img.shields.io/npm/v/@arcanyx/cidr-slicer)](https://www.npmjs.com/package/@arcanyx/cidr-slicer)\n[![main](https://github.com/arcanyx-pub/cidr-slicer-ts/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/arcanyx-pub/cidr-slicer-ts/actions?query=branch%3Amain)\n\nZero-dependency lib for manipulating IP Addresses & CIDR blocks (IPv4 and IPv6). Written in TypeScript.\n\n```shell\nnpm install @arcanyx/cidr-slicer\n```\n\nFeatures:\n - Parse IP addresses:\n   ```typescript\n   ipv6AddressFromString(\"2001:db8::\").toString()  // \"2001:db8::\"\n   ipv6AddressFromString(\"2001:db8::\").toBigInt() // 42540766411282592856903984951653826560n\n   ```\n   \n - Mask IP addresses w/ a prefix length:\n   ```typescript\n   ipv4AddressFromString(\"1.1.1.1\").mask(16).toString()  // \"1.1.0.0\"\n   ```\n\n - Parse CIDR blocks:\n   ```typescript\n   ipv6CidrBlockFromString(\"2001:db8::/64\").prefixLength  // 64\n   ```\n\n - Slice CIDR blocks into smaller blocks:\n   ```typescript\n   const slices = ipv6CidrBlockFromString(\"2001:db8::/32\").slice(48);\n   slices.get(0n).toString();  // \"2001:db8::/48\"\n   slices.get(1n).toString();  // \"2001:db8:1::/48\"\n   ```\n\n- Slice CIDR blocks into smaller blocks, and slice those blocks into even smaller blocks:\n  ```typescript\n  const slices = ipv6CidrBlockFromString(\"2001:db8::/32\").slice(48);\n  const subslices = slices.get(1n).slice(64);\n  subslices.get(1n).toString() // \"2001:db8:1:1::/64\n  ```\n\n## Examples\n\n### Slice IPv6 CIDR Blocks into smaller blocks.\n\n```typescript\nimport {ipv6CidrBlockFromString} from \"@arcanyx/cidr-slicer\";\n\n// Slice a /56 block into /64 block slices.\nconst block = ipv6CidrBlockFromString(\"2001:db8::/56\");  // Type: CidrBlock<Ipv6Address, Ipv6CidrBlockSlices>\nconst slices = block.slice(64);  // Type: Ipv6CidrBlockSlices\n\nfor (let i = 0n; i < slices.length; i++) {\n   // Get and print the i'th block slice.\n    const slice = slices.get(i);  // Type: CidrBlock<Ipv6Address, Ipv6CidrBlockSlices>\n    console.log(`slice ${i}: ${slice}`);\n}\n// Console output:\n//  slice 0: 2001:db8::/64\n//  slice 1: 2001:db8:0:1::/64\n//  slice 2: 2001:db8:0:2::/64\n//  [...]\n//  slice 255: 2001:db8:0:ff::/64\n```\n","readmeFilename":"README.md"}