{"id":18143418,"url":"https://github.com/tristanls/cidr-split","last_synced_at":"2025-04-06T19:29:53.497Z","repository":{"id":141243973,"uuid":"110052575","full_name":"tristanls/cidr-split","owner":"tristanls","description":"Split facility for CIDRs.","archived":false,"fork":false,"pushed_at":"2018-06-02T13:50:51.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-13T01:36:57.183Z","etag":null,"topics":["cidr","math","subnet"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tristanls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-09T01:43:48.000Z","updated_at":"2020-03-31T12:15:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"4691df78-6d6d-413b-bd12-2702aaf11715","html_url":"https://github.com/tristanls/cidr-split","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Fcidr-split","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Fcidr-split/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Fcidr-split/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tristanls%2Fcidr-split/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tristanls","download_url":"https://codeload.github.com/tristanls/cidr-split/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247538622,"owners_count":20955147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cidr","math","subnet"],"created_at":"2024-11-01T19:07:19.439Z","updated_at":"2025-04-06T19:29:53.474Z","avatar_url":"https://github.com/tristanls.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cidr-split\n\n_Stability: 1 - [Experimental](https://github.com/tristanls/stability-index#stability-1---experimental)_\n\n[![NPM version](https://badge.fury.io/js/cidr-split.png)](http://npmjs.org/package/cidr-split)\n\nSplit facility for CIDRs.\n\n## Contributors\n\n[@tristanls](https://github.com/tristanls)\n\n## Contents\n\n  * [Installation](#installation)\n  * [Usage](#usage)\n  * [Tests](#tests)\n  * [Documentation](#documentation)\n    * [CIDR](#cidr)\n  * [Releases](#releases)\n\n## Installation\n\n    npm install cidr-split\n\n## Usage\n\nTo run the below example, run:\n\n    npm run readme\n\n```javascript\n\"use strict\";\n\nconst CIDR = require(\"../index.js\");\n\nconsole.log(\"Split 10.0.0.0/16 into two and print out\");\nCIDR.fromString(\"10.0.0.0/16\").split().map(cidr =\u003e console.log(cidr.toString()));\n\nconsole.log(\"Split 10.0.0.0/16 into four and print out\");\nCIDR.fromString(\"10.0.0.0/16\")\n    .split()\n    .map(cidr =\u003e cidr.split())\n    .reduce((all, halves) =\u003e all.concat(...halves))\n    .map(cidr =\u003e console.log(cidr.toString()));\n\n```\n\n## Tests\n\nNo tests at this time.\n\n## Documentation\n\n  * [CIDR](#cidr)\n\n### CIDR\n\n**Public API**\n\n  * [CIDR.fromString(cidr)](#cidrfromstringcidr)\n  * [cidr.split()](#cidrsplit)\n\n### CIDR.fromString(cidr)\n\n  * `cidr`: _String_ String representation of a CIDR, ex: `10.0.0.0/16`\n  * Return: _CIDR_ CIDR created from the string.\n\nParses `cidr` string and creates a `CIDR` object.\n\n### cidr.split()\n\n  * Retrun: _Array_ Array of two CIDRs, each being one half of the `cidr`.\n\nIf possible, splits the `cidr` into two CIDRs that are half the size.\n\n## Releases\n\nWe follow semantic versioning policy (see: [semver.org](http://semver.org/)):\n\n\u003e Given a version number MAJOR.MINOR.PATCH, increment the:\n\u003e\n\u003eMAJOR version when you make incompatible API changes,\u003cbr/\u003e\n\u003eMINOR version when you add functionality in a backwards-compatible manner, and\u003cbr/\u003e\n\u003ePATCH version when you make backwards-compatible bug fixes.\n\n**caveat**: Major version zero is a special case indicating development version that may make incompatible API changes without incrementing MAJOR version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristanls%2Fcidr-split","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftristanls%2Fcidr-split","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftristanls%2Fcidr-split/lists"}