# load-ip-set

> download and parse ip-set (blocklist) files

Latest version **3.0.2** (published 2026-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install load-ip-set
pnpm add load-ip-set
yarn add load-ip-set
bun add load-ip-set
```

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; has provenance.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2026-05-25 |
| First published | 2014-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12.20.0 |
| Dependencies | 6 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 24 |
| Author | WebTorrent LLC |
| Maintainers | feross, mafintosh, flet, watson, diegorbaquero, hicom150, jhiesey, webtorrent-bot, alxhotel |
| Keywords | torrent, ip set, download, parse, blocklist, blacklist, ip list, webtorrent |

## Links

- npm: https://www.npmjs.com/package/load-ip-set
- Repository: https://github.com/webtorrent/load-ip-set
- Homepage: https://github.com/webtorrent/load-ip-set#readme
- Issues: https://github.com/webtorrent/load-ip-set/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/load-ip-set

## Dependencies (6)

- [once](https://npm.io/package/once.md) ^1.4.0
- [split](https://npm.io/package/split.md) ^1.0.1
- [ip-set](https://npm.io/package/ip-set.md) ^3.0.0
- [netmask](https://npm.io/package/netmask.md) ^2.0.1
- [queue-microtask](https://npm.io/package/queue-microtask.md) ^1.2.3
- [cross-fetch-ponyfill](https://npm.io/package/cross-fetch-ponyfill.md) ^1.0.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2026-05-25
- 3.0.1 — 2023-01-25
- 3.0.0 — 2022-11-24
- 2.2.1 — 2021-03-30
- 2.2.0 — 2021-03-30
- 2.1.2 — 2020-11-17
- 2.1.1 — 2020-10-27
- 2.1.0 — 2018-07-27
- 2.0.0 — 2018-04-25
- 1.3.1 — 2017-04-14
- 1.3.0 — 2016-07-26
- 1.2.7 — 2016-03-11
- 1.2.6 — 2016-02-15
- 1.2.5 — 2016-02-13
- 1.2.4 — 2015-06-10
- … 13 more at https://npm.io/package/load-ip-set/versions

## README

# load-ip-set [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[ci-image]: https://github.com/webtorrent/load-ip-set/actions/workflows/ci.yml/badge.svg?branch=master
[ci-url]: https://github.com/webtorrent/load-ip-set/actions
[npm-image]: https://img.shields.io/npm/v/load-ip-set.svg
[npm-url]: https://npmjs.org/package/load-ip-set
[downloads-image]: https://img.shields.io/npm/dm/load-ip-set.svg
[downloads-url]: https://npmjs.org/package/load-ip-set
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

#### download and parse ip-set (blocklist) files

This module is used by [WebTorrent](http://webtorrent.io)!

### Install

```
npm install load-ip-set
```

### Usage

Given one of the following:

- http/https url (gzip, deflate, or no compression)
- filesystem path (gzip, or no compression)
- array of ip addresses or `{ start: '1.2.3.0', end: '1.2.3.255' }` ip ranges

this module loads the ip set (downloading from the network, if necessary) and returns an [ip-set](https://www.npmjs.org/package/ip-set) object. An `ip-set` is just a mutable set data structure optimized for use with IPv4 and IPv6 addresses.

```js
import loadIPSet from 'load-ip-set'
loadIPSet('http://example.com/list.txt', (err, ipSet) => {
  if (err) throw err
  ipSet.contains('1.2.3.4') //=> true
  ipSet.contains('2.2.2.2') //=> false
})
```

The second argument can be an optional `opts` object which will be passed to
[`simple-get`](https://npmjs.com/package/simple-get) and the node.js core `http.request`
method. This is useful for setting the user agent, for example.

```js
loadIPSet('http://example.com/list.txt', {
  headers: {
    'user-agent': 'WebTorrent (http://webtorrent.io)'
  }
}, (err, ipSet) => {

})
```

### License

MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org) and [WebTorrent, LLC](https://webtorrent.io).

---
_Source: https://npm.io/package/load-ip-set · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
