You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For simplicity, all functions will only ever return String, String[], boolean, or null.
By default the library will fail silently and null is returned when errors are encountered. To override this setting set the optional throwErrors parameter to True.
By default the library will conveniently mask out provided network values to their base address when such an operation makes sense. To override this setting set the optional strict parameter to True where applicable.
Benchmarks
npm run bench
'index.bench.ts' output:
baseAddress (netparser) x 1,996,413 ops/sec ±0.37% (98 runs sampled)
baseAddress (ip-address) x 1,188,792 ops/sec ±4.63% (83 runs sampled)
baseAddress (ipaddr.js) x 825,180 ops/sec ±0.62% (93 runs sampled)
baseAddress (netmask) x 577,742 ops/sec ±1.79% (90 runs sampled)
contains (netparser) x 909,425 ops/sec ±1.81% (92 runs sampled)
contains (ip-address) x 925,975 ops/sec ±1.93% (89 runs sampled)
contains (ipaddr.js) x 43,187 ops/sec ±0.56% (94 runs sampled)
contains (netmask) x 489,932 ops/sec ±1.12% (91 runs sampled)
'match.bench.ts' output:
create (netparser) x 14.56 ops/sec ±1.19% (40 runs sampled)
create (cidr-matcher) x 7.99 ops/sec ±1.57% (24 runs sampled)
create (ipaddr.js) x 35.44 ops/sec ±4.72% (48 runs sampled)
query (netparser) x 159,486 ops/sec ±0.52% (92 runs sampled)
query (cidr-matcher) x 1,107 ops/sec ±1.55% (88 runs sampled)
query (ipaddr.js) x 14.54 ops/sec ±0.49% (40 runs sampled)