Socket
Socket
Sign inDemoInstall

express-ipfilter

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-ipfilter - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

1

index.d.ts

@@ -19,2 +19,3 @@ import express = require('express');

logLevel?: 'all' | 'deny' | 'allow';
logF?: (message: string) => void;
mode?: 'deny' | 'allow';

@@ -21,0 +22,0 @@ // `@types/proxy-addr` does not export the `trust` parameter type

10

package.json
{
"name": "express-ipfilter",
"version": "1.1.2",
"version": "1.2.0",
"description": "A light-weight IP address based filtering system",

@@ -88,8 +88,8 @@ "keywords": [

"devDependencies": {
"eslint": "^6.0.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-jest": "^23.0.2",
"eslint": "^7.1.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-jest": "^24.1.3",
"eslint-plugin-prettier": "^3.0.1",
"husky": "^4.0.0",
"jest": "^25.1.0",
"jest": "^26.0.1",
"lint-staged": "^10.0.0",

@@ -96,0 +96,0 @@ "prettier": "^2.0.1"

# express-ipfilter: A light-weight IP address based filtering system
This package provides easy IP based access control. This can be achieved either by blacklisting certain IPs and whitelisting all others, or whitelisting certain IPs and blacklisting all others.
This package provides easy IP based access control. This can be achieved either by denying certain IPs and allowing all others, or allowing certain IPs and denying all others.

@@ -13,3 +13,3 @@ ## Installation

Blacklisting certain IP addresses, while allowing all other IPs:
Denying certain IP addresses, while allowing all other IPs:

@@ -21,3 +21,3 @@ ```javascript

// Blacklist the following IPs
// Allow the following IPs
const ips = ['127.0.0.1']

@@ -30,3 +30,3 @@

Whitelisting certain IP addresses, while denying all other IPs:
Allowing certain IP addresses, while denying all other IPs:

@@ -39,3 +39,3 @@ ```javascript

// Whitelist the following IPs
// Allow the following IPs
const ips = ['127.0.0.1']

@@ -87,3 +87,3 @@

```javascript
let whitelist_ips = ['10.1.*.*', '123.??.34.8*'] // matches '10.1.76.32' and '123.77.34.89'
let allowlist_ips = ['10.1.*.*', '123.??.34.8*'] // matches '10.1.76.32' and '123.77.34.89'

@@ -96,6 +96,5 @@ let clientIp = function(req, res) {

ipFilter({
id: clientIp,
detectIp: clientIp,
forbidden: 'You are not authorized to access this page.',
strict: false,
filter: whitelist_ips,
filter: allowlist_ips,
})

@@ -153,3 +152,3 @@ )

ipfilter(ids, { detectIp: customDetection })
ipfilter(ips, { detectIp: customDetection })
```

@@ -156,0 +155,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