Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ipmatcher

poying14MIT1.0.4

ipmatcher

ip, matcher, ipv4, ipv6

readme

ipmatcher

Build Status npm

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)

http://poying.mit-license.org/