Efficient mutable set for IP addresses
Last updated a year ago by fisch0920 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ip-set 
SYNC missed versions from official npm registry.

ip-set travis npm

IP Address Set

browser support

Efficient mutable set data structure optimized for use with IPv4 and IPv6 addresses. The primary use case is for working with potentially large IP blacklists.

Works in the browser with browserify! This module is used by WebTorrent.


npm install ip-set


var ipSet = require('ip-set')(/* optionally pass an array of IP addresses to seed the set with */)
var isBlocked = ipSet.contains(exampleBlockedIP2) // isBlocked will be true

CIDR ip's are also supported

var isBlockedInList= ipSet.contains('');// isBlockedInList will be true
isBlockedInList= ipSet.contains('');// isBlockedInList will be true


(prioritized highest to lowest)

  • [x] Port IPv4 implementation from torrent-stream
  • [x] Add basic tests
  • [x] Support CIDR notation
  • [ ] Support IPv6
  • [ ] Investigate potential use of node-iptrie


Original interval-tree written by galedric for torrent-stream. Ported to an isolated npm module by transitive-bullshit for webtorrent.


MIT. Copyright (c) Travis Fischer

Current Tags

  • 1.0.2                                ...           latest (a year ago)

3 Versions

  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           6 years ago
Maintainers (1)
Today 2
This Week 27
This Month 153
Last Day 5
Last Week 51
Last Month 135
Dependencies (1)
  • ip ^1.1.3
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |