{"id":18851602,"url":"https://github.com/eviltik/cidr-clean","last_synced_at":"2025-04-14T09:52:59.102Z","repository":{"id":26454804,"uuid":"108924410","full_name":"eviltik/cidr-clean","owner":"eviltik","description":"Merge CIDRs list, cleanup, and handle overlaps","archived":false,"fork":false,"pushed_at":"2023-03-05T19:54:21.000Z","size":531,"stargazers_count":8,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-15T11:01:11.755Z","etag":null,"topics":["cidr"],"latest_commit_sha":null,"homepage":"","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/eviltik.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-10-31T00:36:24.000Z","updated_at":"2024-06-14T04:31:03.000Z","dependencies_parsed_at":"2024-09-16T05:01:46.487Z","dependency_job_id":"51347877-3d9c-461f-8421-abb2349c1472","html_url":"https://github.com/eviltik/cidr-clean","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fcidr-clean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fcidr-clean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fcidr-clean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eviltik%2Fcidr-clean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eviltik","download_url":"https://codeload.github.com/eviltik/cidr-clean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860118,"owners_count":21173339,"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"],"created_at":"2024-11-08T03:35:24.065Z","updated_at":"2025-04-14T09:52:59.073Z","avatar_url":"https://github.com/eviltik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cidr-clean\n-----------\n![Node.js CI](https://github.com/eviltik/cidr-clean/workflows/Node.js%20CI/badge.svg)\n[![npm version](https://badge.fury.io/js/cidr-clean.svg)](https://badge.fury.io/js/cidr-clean)\n[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)\n[![Dependencies](https://david-dm.org/eviltik/cidr-clean.svg)](https://david-dm.org/eviltik/cidr-clean)\n\nWhat for ?\n----------\n\nClean an array of CIDR\n* remove duplicates\n* remove comments\n* remove bad CIDRs\n* remove extra spaces\n* choose the heaviest network in case of overlap\n\n\nInstallation\n------------\n```\n$ npm install cidr-clean\n```\n\n\nUsage\n-----\n```\nconst cidrClean = require('cidr-clean');\n\nlet list = [\n    '#mycomment',\n    '10.1.2.0/23',\n    '110.1.3.248/30',\n    '1.2.3.4/10'\n];\n\nconsole.log(cidrClean(list));\n\n# output: ['10.1.2.0/23', '110.1.3.248/30', '1.2.3.4/10'];\n\n# note, you can cidrClean(list1, list2) for merging 2 cidr lists\n```\n\nTodo\n----\n* optional callback with all events (remove, overlap)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feviltik%2Fcidr-clean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feviltik%2Fcidr-clean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feviltik%2Fcidr-clean/lists"}