geofeed2ranges
v1.0.0
Published
Library to extract IP ranges from an RFC 8805 geofeed
Readme
geofeed2ranges
Library to extract IP ranges from an RFC 8805 geofeed.
Install
npm install geofeed2rangesExample
Read from URL
import { geofeedToRanges } from 'geofeed2ranges'
const httpRes = await fetch(
'https://raw.githubusercontent.com/tmobile/tmus-geofeed/main/tmus-geo-ip.txt',
)
for await (const ln of geofeedToRanges(httpRes.body)) {
console.log(ln)
}Read from file
import { createReadStream } from 'node:fs'
import { geofeedToRanges } from 'geofeed2ranges'
const file = createReadStream('geofeed.csv')
for await (const ln of geofeedToRanges(file)) {
console.log(ln)
}