1.1.7 • Published 3 years ago

cidr-clean v1.1.7

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

cidr-clean


Node.js CI npm version MIT Licence Dependencies

What for ?

Clean an array of CIDR

  • remove duplicates
  • remove comments
  • remove bad CIDRs
  • remove extra spaces
  • choose the heaviest network in case of overlap

Installation

$ npm install cidr-clean

Usage

const cidrClean = require('cidr-clean');

let list = [
    '#mycomment',
    '10.1.2.0/23',
    '110.1.3.248/30',
    '1.2.3.4/10'
];

console.log(cidrClean(list));

# output: ['10.1.2.0/23', '110.1.3.248/30', '1.2.3.4/10'];

# note, you can cidrClean(list1, list2) for merging 2 cidr lists

Todo

  • optional callback with all events (remove, overlap)
1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.2

5 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago