ipmatcher
v1.0.4
Published
ipmatcher
Downloads
5
Readme
ipmatcher
var assert = require('assert');
var matcher = require('ipmatcher');
var match = matcher.create([
'0.0.0.0',
'192.168.*.*',
'220.134.214.167/16',
'fe80::0:0:0:0/70'
]);
assert(match('0.0.0.0'));
assert(match('192.168.1.1'));
assert(match('220.134.214.1'));
assert(!match('127.0.0.1'));
Installation
$ npm i --save ipmatcher
Supports
- IPv4
- IPv4 subnet
- IPv6
- IPv6 subnet
License
The MIT License (MIT)