
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
get-ip-range
Advanced tools
Simple utility to convert either CIDR notation or two IP addresses to an array of the range of IP addresses
Simple utility to convert either CIDR notation, a hyphenated IP range, or two IP addresses to an array of the range of IP addresses.
$ npm i get-ip-range
"x.x.x.x/x"
"x.x.x.x-x.x.x.x"
"x.x.x.x", "x.x.x.x"
"x:x:x:x:x:x:x:x/x"
"::x:x:x-::x:x:x"
"::x:x:x", "::x:x:x"
N.B. Shorthand IPv6 is supported
import { getIPRange } from 'get-ip-range';
const ipv4CIDR = getIPRange('192.168.1.134/29');
const ipv4Range = getIPRange('192.168.1.128-192.168.1.135');
const twoIPv4 = getIPRange('192.168.1.128', '192.168.1.135');
// All return:
[
'192.168.1.128',
'192.168.1.129',
'192.168.1.130',
'192.168.1.131',
'192.168.1.132',
'192.168.1.133',
'192.168.1.134',
'192.168.1.135',
]
const ipv6CIDR = getIPRange('0:0:0:0:0:ffff:102:304/126');
const ipv6Range = getIPRange('::ffff:102:304-::ffff:102:307');
const twoIPv6 = getIPRange('::ffff:102:304', '::ffff:102:307');
// All return:
[
'::ffff:102:304',
'::ffff:102:305',
'::ffff:102:306',
'::ffff:102:307',
]
Errors
Joe Schofield 💻 | Miosame 💻 | João Antunes 💻 | Chingiz Toimbetov 💻 | yaniv-checkmarx 🐛 | Stanislav Sizonenko 🐛 |
FAQs
Simple utility to convert either CIDR notation or two IP addresses to an array of the range of IP addresses
The npm package get-ip-range receives a total of 5,098 weekly downloads. As such, get-ip-range popularity was classified as popular.
We found that get-ip-range demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.