Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-ip-range

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-ip-range - npm Package Compare versions

Comparing version 2.1.1 to 3.0.0

index.ts

5

CHANGELOG.md

@@ -0,1 +1,6 @@

## v3.0.0
- Refactor to TypeScript
- New error messages introduced
- Export { `getIPRange` }
## v2.1.1

@@ -2,0 +7,0 @@ - Fix error message

51

package.json
{
"name": "get-ip-range",
"version": "2.1.1",
"version": "3.0.0",
"description": "Simple utility to convert either CIDR notation or two IP addresses to an array of the range of IP addresses",
"main": "index.js",
"directories": {
"test": "test"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"test": "nyc --reporter=html --reporter=text mocha *.test.js",
"jshint": "jshint *.js *.test.js",
"code-style": "jscs -p airbnb --fix *.js *.test.js",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"check-coverage": "nyc check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
"open-coverage": "open coverage/index.html"
"test": "jest --coverage",
"build": "tsc",
"prepare": "npm run build"
},
"files": [
"LICENSE",
"README.md",
"index.js"
"index.ts"
],

@@ -37,31 +30,13 @@ "keywords": [

"devDependencies": {
"chai": "^4.1.2",
"@types/ip": "^1.1.0",
"coveralls": "^3.0.2",
"jscs": "^3.0.7",
"jshint": "^2.10.1",
"mocha": "^5.2.0",
"nyc": "^14.1.1"
"jest": "^26.5.3",
"pre-commit": "^1.2.2",
"ts-jest": "^26.4.1",
"typescript": "^4.0.3"
},
"pre-commit": [
"jshint",
"code-style",
"test",
"check-coverage"
"test"
],
"jshintConfig": {
"boss": true,
"node": true,
"strict": false,
"smarttabs": true,
"maxlen": 100,
"newcap": false,
"undef": true,
"unused": true,
"onecase": true,
"indent": 2,
"sub": true,
"esversion": 8
},
"dependencies": {
"cidr-regex": "^1.0.7",
"ip": "^1.1.5",

@@ -68,0 +43,0 @@ "ip-address": "^6.1.0"

@@ -25,3 +25,3 @@ # get-ip-range

* Range `"x.x.x.x-x.x.x.x"`
* Two IPs `"x.x.x.x, x.x.x.x"`
* Two IPs `"x.x.x.x", "x.x.x.x"`

@@ -38,4 +38,4 @@ ### IPv6

## Usage
```js
const getIPRange = require('get-ip-range');
```ts
import { getIPRange } from 'get-ip-range';

@@ -47,14 +47,12 @@ const ipv4CIDR = getIPRange('192.168.1.134/29');

// 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',
// ]
//
[
'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',
]

@@ -66,10 +64,8 @@ const ipv6CIDR = getIPRange('0:0:0:0:0:ffff:102:304/126');

// All return:
//
// [
// '::ffff:102:304',
// '::ffff:102:305',
// '::ffff:102:306',
// '::ffff:102:307',
// ]
//
[
'::ffff:102:304',
'::ffff:102:305',
'::ffff:102:306',
'::ffff:102:307',
]
```

@@ -76,0 +72,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc