Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

ip-set

1.0.1 • Public • Published

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.

install

npm install ip-set

usage

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

todo

(prioritized highest to lowest)

  • Port IPv4 implementation from torrent-stream
  • Add basic tests
  • Support IPv6
  • Investigate potential use of node-iptrie

credits

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

license

MIT. Copyright (c) Travis Fischer

install

npm i ip-set

Downloadsweekly downloads

2,250

version

1.0.1

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability